11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry PiでMJPG-streamerを使う

Posted at

Webカメラの接続確認

$ lsusb

MJPG-streamerのインストール

$ sudo apt-get update
$ sudo apt-get install -y subversion libjpeg-dev imagemagick
$ svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer
cd mjpg-streamer
./configure
make
sudo make install

MJPG-streamerの起動スクリプト

BASIC認証無効

ファイル名.sh
#!/bin/sh
PORT="8080" #ポート番号
SIZE="320x240" #画面サイズ
FRAMERATE="1" #フレームレート
export LD_LIBRARY_PATH=/usr/local/lib
mjpg_streamer \
-i "input_uvc.so -f $FRAMERATE -r $SIZE -d /dev/video0 -y" \
-o "output_http.so -w /usr/local/www -p $PORT"

BASIC認証有効

ファイル名.sh
#!/bin/sh
PORT="8080" #ポート番号
ID="xxx" #ID
PW="xxx" #パスワード
SIZE="320x240" #画面サイズ
FRAMERATE="1" #フレームレート
export LD_LIBRARY_PATH=/usr/local/lib
mjpg_streamer \
-i "input_uvc.so -f $FRAMERATE -r $SIZE -d /dev/video0 -y" \
-o "output_http.so -w /usr/local/www -p $PORT -c $ID:$PW"

起動スクリプトのパーミッションを変更

$ chmod 755 ファイル名.sh
11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?