mjpg-streamer
转:http://tieba.baidu.com/p/2982276084
http://www.linuxidc.com/Linux/2012-05/59449.htm
http://static.oschina.net/uploads/img/201407/25170549_AGuz.png
https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/www/stream.html
fswebcam http://www.tuicool.com/articles/UzMbIb
motion http://code.csdn.net/news/2820789 http://www.chriswpage.com/2009/05/setup-an-advanced-webcam-security-system-with-ubuntu-8-04-and-motion/
1.将USB摄像头插上,查看是否找到设备,输入:
root@raspberrypi:/# ls /dev/vid*
/dev/video0
复制代码看到video0就对啦,如果找不到可能驱动不对,或者工作不正常,看看供电,装装驱动试试
2.安装必要的软件集:
sudo apt-get install subversion
sudo apt-get install libv4l-dev #armbian貌似不可以
sudo apt-get install libjpeg62-dev #armbian貌似不可以
sudo apt-get install libjpeg8-dev
sudo apt-get install imagemagick
下载mipg-steamer软件,编译并安装:
svn co https://svn.code.sf.net/p/mjpg-streamer/code mjpg-streamer
cd mjpg-streamer/mjpg-streamer
apt-get install gcc
apt-get install make
make clean all
sudo make install
之后去添加路径
sudo nano /etc/proflie
在最后一行添加export LD_LIBRARY_PATH=/usr/local/lib
保存,重启即可
[root@www.linuxidc.com mjpg-streamer/mjpg-streamer-experimental]# ./start.sh
http://www.tuicool.com/articles/rIne22f
cat start.sh
30 #./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"
31
32 ./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -y -r 640x480 -f 20" -o "./output_http.so -p 8090 -c test:123456 -w ./www" -o "output_file.so -d 60000 -f /home/pi"
root@raspberrypi:/home/pi/mjpg-streamer/mjpg-streamer#cat start.sh
#!/bin/sh
#/******************************************************************************
# #
# MJPG-streamer allows to stream JPG frames from an input-plugin #
# to several output plugins #
# #
# Copyright (C) 2007 Tom St枚veken #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
#******************************************************************************/
## This example shows how to invoke mjpg-streamer from the command line
export LD_LIBRARY_PATH="$(pwd)"
#./mjpg_streamer -i "input_uvc.so --help"
#./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www -c test:123456"
#./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -y -r 640x480 -f 15" -o "./output_http.so -p 8090 -c test:123456 -w ./www" -o "output_file.so -d 60000 -f /home/pi"
./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -y -r 640x480 -f 15" -o "./output_http.so -p 8090 -c test:123456 -w ./www" -o "output_file.so"
#./mjpg_streamer -i "./input_uvc.so -d /dev/video0" -i "./input_uvc.so -d /dev/video1" -o "./output_http.so -w ./www"
#valgrind ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"
#./mjpg_streamer -i "./input_uvc.so" -o "./output_udp.so -p 2001"
## pwd echos the current path you are working at,
## the backticks open a subshell to execute the command pwd first
## the exported variable name configures ldopen() to search a certain
## folder for *.so modules
#export LD_LIBRARY_PATH=`pwd`
## this is the minimum command line to start mjpg-streamer with webpages
## for the input-plugin default parameters are used
#./mjpg_streamer -o "output_http.so -w `pwd`/www"
## to query help for the core:
# ./mjpg_streamer --help
## to query help for the input-plugin "input_uvc.so":
# ./mjpg_streamer --input "input_uvc.so --help"
## to query help for the output-plugin "output_file.so":
# ./mjpg_streamer --output "output_file.so --help"
## to query help for the output-plugin "output_http.so":
# ./mjpg_streamer --output "output_http.so --help"
## to specify a certain device, framerage and resolution for the input plugin:
# ./mjpg_streamer -i "input_uvc.so -d /dev/video2 -r 320x240 -f 10"
## to start both, the http-output-plugin and write to files every 15 second:
# mkdir pics
# ./mjpg_streamer -o "output_http.so -w `pwd`/www" -o "output_file.so -f pics -d 15000"
## to protect the webserver with a username and password (!! can easily get sniffed and decoded, it is just base64 encoded !!)
# ./mjpg-streamer -o "output_http.so -w ./www -c UsErNaMe:SeCrEt"
## If you want to track down errors, use this simple testpicture plugin as input source.
## to use the testpicture input plugin instead of a webcam or folder:
#./mjpg_streamer -i "input_testpicture.so -r 320x240 -d 500" -o "output_http.so -w www"
## The input_file.so plugin watches a folder for new files, it does not matter where
## the JPEG files orginate from. For instance it is possible to grab the desktop and
## store the files to a folder:
# mkdir -p /tmp/input
# while true; do xwd -root | convert - -scale 640 /tmp/input/bla.jpg; sleep 0.5; done &
## Then the files can be read from the folder "/tmp/input" and served via HTTP
# ./mjpg_streamer -i "input_file.so -f /tmp/input -r" -o "output_http.so -w www"
## To upload files to a FTP server (edit the script first)
# ./mjpg_streamer -i input_testpicture.so -o "output_file.so --command plugins/output_file/examples/ftp_upload.sh"
## To create a control only interface useful for controlling the pan/tilt throug
## a webpage while another program streams video/audio, like skype.
#./mjpg_streamer -i "./input_control.so" -o "./output_http.so -w ./www"