Screen Shot 2015-07-18 at 6.17.41 PM

[RaspberryPi]pidoraにmjpg-streamerをインストールする

[RaspberryPi]pidoraにmjpg-streamerをインストールする

RaspberryPiとWebCamでストリーミングサーバーにできるmjpg-streamerをインストールしたメモ.._〆(゚▽゚*)

sudo yum install -y ImageMagick libjpeg-turbo-devel subversion
sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h
cd /usr/src
sudo svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code
cd mjpg-streamer-code-182/mjpg-streamer
sudo make
sudo make install
# install --mode=755 mjpg_streamer /usr/local/bin
# install --mode=644 input_uvc.so output_file.so output_udp.so output_http.so input_testpicture.so input_file.so /usr/local/lib/
# install --mode=755 -d /usr/local/www
# install --mode=644 -D www/* /usr/local/www
sudo mknod /dev/video0 c 81 0
sudo modprobe bcm2835-v4l2
sudo /usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so -d /dev/video0 -r 320x240" -o "/usr/local/lib/output_http.so -w /usr/local/www -p 80"

MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 320 x 240
 i: Frames Per Second.: 5
 i: Format............: MJPEG
Adding control for Pan (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan/tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Focus (absolute)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
mapping control for Pan (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan/tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Focus (absolute)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Mode
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Frequency
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Disable video processing
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Raw bits per pixel
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
 o: www-folder-path...: /usr/local/www/
 o: HTTP TCP port.....: 80
 o: username:password.: disabled
 o: commands..........: enabled

な・・・なにィ~~~~
いま・・・動いたぞ・・・こいつ・・・バカなッ!

Screen_Shot_2015-06-26_at_4.43.07_PM

mknodとか、modprobeって知らないコマンドがでてきたり、用語もあっていろいろあいまいなんだけど、なんか動いた。
以下はまったところ

エラー1:jpeglib.hが見当たらない

raspberry@pidora:/usr/src/mjpg-streamer/mjpg-streamer$ sudo make
[sudo] password for raspberry: 
make: svnversion: Command not found
gcc -D'SVN_REV=""' -O2 -DLINUX -D_GNU_SOURCE -Wall    -c -o mjpg_streamer.o mjpg_streamer.c
gcc -D'SVN_REV=""' -O2 -DLINUX -D_GNU_SOURCE -Wall    -c -o utils.o utils.c
gcc -D'SVN_REV=""' -O2 -DLINUX -D_GNU_SOURCE -Wall  mjpg_streamer.o utils.o -lpthread -ldl -o mjpg_streamer
chmod 755 mjpg_streamer
make -C plugins/input_uvc all
make[1]: Entering directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/input_uvc'
gcc -c -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o v4l2uvc.lo v4l2uvc.c
v4l2uvc.c: In function 'init_videoIn':
v4l2uvc.c:88:23: warning: variable 'currentHeight' set but not used [-Wunused-but-set-variable]
     int currentWidth, currentHeight = 0;
                       ^
v4l2uvc.c:88:9: warning: variable 'currentWidth' set but not used [-Wunused-but-set-variable]
     int currentWidth, currentHeight = 0;
         ^
gcc -c -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o jpeg_utils.lo jpeg_utils.c
jpeg_utils.c:27:21: fatal error: jpeglib.h: No such file or directory
 #include <jpeglib.h>
                     ^
compilation terminated.
make[1]: *** [jpeg_utils.lo] Error 1
make[1]: Leaving directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/input_uvc'
make: *** [input_uvc.so] Error 2

エラー2:ImageMagickが見当たらない

raspberry@pidora:/usr/src/mjpg-streamer/mjpg-streamer$ sudo make
make: svnversion: Command not found
make -C plugins/input_uvc all
make[1]: Entering directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/input_uvc'
gcc -c -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o jpeg_utils.lo jpeg_utils.c
gcc -c -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o dynctrl.lo dynctrl.c
gcc -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o input_uvc.so input_uvc.c v4l2uvc.lo jpeg_utils.lo dynctrl.lo -ljpeg
make[1]: Leaving directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/input_uvc'
cp plugins/input_uvc/input_uvc.so .
make -C plugins/output_file all
make[1]: Entering directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/output_file'
gcc -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o output_file.so output_file.c
make[1]: Leaving directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/output_file'
cp plugins/output_file/output_file.so .
make -C plugins/output_udp all
make[1]: Entering directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/output_udp'
gcc -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o output_udp.so output_udp.c
make[1]: Leaving directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/output_udp'
cp plugins/output_udp/output_udp.so .
make -C plugins/output_http all
make[1]: Entering directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/output_http'
gcc -c -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o httpd.lo httpd.c
gcc -O1 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o output_http.so output_http.c httpd.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/output_http'
cp plugins/output_http/output_http.so .
make -C plugins/input_testpicture all
make[1]: Entering directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/input_testpicture'
convert pictures/960x720_1.jpg -resize 640x480! pictures/640x480_1.jpg
/bin/sh: convert: command not found
make[1]: *** [pictures/640x480_1.jpg] Error 127
make[1]: Leaving directory `/usr/src/mjpg-streamer/mjpg-streamer/plugins/input_testpicture'
make: *** [input_testpicture.so] Error 2

エラー3:/dev/video0のスペシャルファイルが見当たらない

raspberry@pidora:/usr/src/mjpg-streamer-code-182/mjpg-streamer$ /usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so -d /dev/video0 -r 320x240 -f 3" -o "/usr/local/lib/output_http.so -w /usr/local/www -p 8080"
MJPG Streamer Version: svn rev: 
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 320 x 240
 i: Frames Per Second.: 3
 i: Format............: MJPEG
ERROR opening V4L interface: No such file or directory
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed

参考なったリンクさま

About the author
  • コメントを残す