目的
Raspberrypi + UbuntuMate18.04+ + MJPG-streamer + USB Webカメラで監視カメラ
(何番煎じか分かりませんが自分の備忘録のためですすみません。)
前提
Raspberrypi に UbuntuMate18.04 をインストールしていること
USB WebカメラはRaspberrypiのUSBポートに接続する
MJPG-streamer
以下を参考に環境構築
MJPG-streamerをインストール
sudo apt-get update
sudo apt-get install -y subversion libjpeg-dev imagemagick
sudo apt install make
sudo apt install make-guile
sudo apt install gcc
svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer
cd mjpg-streamer
make
sudo make install
MJPG-streamerを起動
sudo ./mjpg_streamer -i "./input_uvc.so -f 10 -r 320x240 -d /dev/video0 -y -n" -o "./output_http.so -w ./www -p 8080"
テスト
ブラウザからlocalhost:8080にアクセスして映像が出力されればOK

他のPCからアクセスしたい場合は、http://(IPアドレス):8080にアクセスする
Command 'make' not found
$ make
Command 'make' not found, but can be installed with:
sudo apt install make
sudo apt install make-guile
gcc: Command not found
$ make
gcc -D'SVN_REV="3:172"' -O2 -DLINUX -D_GNU_SOURCE -Wall -c -o mjpg_streamer.o mjpg_streamer.c
make: gcc: Command not found
<builtin>: recipe for target 'mjpg_streamer.o' failed
make: *** [mjpg_streamer.o] Error 127
$ gcc
Command 'gcc' not found, but can be installed with:
sudo apt install gcc
gccをインストールして解決
sudo apt install gcc
その他
自宅ネットワーク外からアクセスする方法は次の課題(これも何番煎じかわからない。。)