Ubuntu 14.10下源码安装MJPG-Streamer及使用
1. sudo apt-get install libv4l-dev libjpeg-dev
2. 安装 svn 并配置代理
sudo apt-get install subversion
$ sudo vi /etc/subversion/servers [Global] http-proxy-host=172.16.2.187 http-proxy-port=8080
3. download code
svn checkout http://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code
4.安装 imagemagick 否则出现下面错误
sudo apt-get install imagemagick
convert pictures/960x720_1.jpg -resize 320x240! pictures/320x240_1.jpg /bin/sh: 1: convert: not found make[1]: *** [pictures/320x240_1.jpg] Error 127
5. cd mjpg-streamer-code/mjpg-streamer
make clean all
make USE_LIBV4L2=true
echo $LD_LIBRARY_PATH 还需要添加/user/local/lib路径
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
/home/odroid/catkin_ws/devel/lib:/home/odroid/catkin_ws/devel/lib/arm-linux-gnueabihf:/opt/ros/indigo/lib:/opt/ros/indigo/lib/arm-linux-gnueabihf
测试命令 mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480 -f 10" -o "output_http.so -p 8080 -w /var/www/mjpg_streamer"
6 创建启动脚本
6 创建启动脚本
vi /etc/init/mjpg-streamer.conf
start on login-session-start script export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480 -f 40" -o "output_http.so -p 8080 -w /var/www/mjpg_streamer" end script