tomato连摄像头定时拍照,其实可以更简单
本帖最后由 kure 于 2013-5-13 18:12 编辑mjpg_streamer -i "input_uvc.so -r 1280x780 -f 10 -l off " -o "output_http.so -p 8080 -c xxx:yyy -w /opt/share/mjpg-streamer/www" -o "output_file.so -f /mnt/sda1 -d 1000"
只要在启动output_http.so后面再用output_file.so 设置好目录和间隔时间就可以了,不影响在线查看的密码。
我还看到http://sourceforge.net/apps/medi ... p?title=Output_file,上面这个脚本有可能是覆盖用的。我先测试看看。 这个方法相比坛中高手用FTP的简单很多,当然,灵活性是比不上的。 本帖最后由 kure 于 2013-5-13 18:39 编辑
kure 发表于 2013-5-13 17:42 static/image/common/back.gif
这个方法相比坛中高手用FTP的简单很多,当然,灵活性是比不上的。
#!/bin/bash
# comment out the following line to disable messages
VERBOSE=1
if [ $VERBOSE ]; then
echo -e "Rename script started at:\t$(date)";
echo -e "Parameter \$1 is:\t\t$1"
echo -e "current directory is:\t\t$(pwd)"
echo -e "move command is:\t\tmv -T -f \"$1\" 'moved.jpg'"
fi
# move the temporary file to a given filename
mv -T -f "$1" 'moved.jpg'
RES=$?
if [ $VERBOSE ]; then
echo -e "move command returned:\t\t$RES"
fi
代码发上来,正在测试。
测试完了? 脚本什么用不清楚,也不能自动覆盖。
但是最前面的命令是没问题的 kure 发表于 2013-5-15 11:56
脚本什么用不清楚,也不能自动覆盖。
但是最前面的命令是没问题的
root@unknown:/tmp/home/root# mjpg_streamer -i "input_uvc.so -r 1280x780 -f 10 -l
off " -o "output_http.so -p 8080 -c xxx:yyy -w /opt/share/mjpg-streamer/www" -o
"output_file.so -f /opt -d 1000"
MJPG Streamer Version: svn rev: wyeksportowane
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1280 x 780
i: Frames Per Second.: 10
i: Format............: MJPEG
Unable to set format: 1196444237 res: 1280x780
Init v4L2 failed !! exit fatal
i: init_VideoIn failed
经过测试命令无法使用 你们的mjpg-streamer都是连续开一天进程不死掉的? 好文章。做个记号。回头研究一下。 做好记号,准备往后使用 output_http.so 和output_file.so 这2个文件怎么弄? MJPG Streamer Version: svn rev: wyeksportowane
ERROR: could not find input plugin
Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: File not found
可以了,要把开启的摄像头停了,再用楼主的命令启动行了,10分钟等于600000毫秒,拍照一次。 output_file.so- File output plugin.
-f | --folder <DIRECTORY>
Directory to save pictures.
-m | --mjpeg
Save the stream to an mjpeg file.
-d | --delay <DELAY>
Delay after saving pictures in ms.
-s | --size <NUMBER>
Size of ring buffer (max number of pictures to hold).
-e | --exceed <NUMBER>
Allow ringbuffer to exceed limit by this amount.
-c | --command <COMMAND>
Execute command after saving picture.
测试了一下,可以用-s 参数设定循环拍照,比如 -s 200,那就只能存200张照片,不断地滚动覆盖,像行车记录仪 自己备注一下:
外网访问可以用命令iptables -I INPUT -p tcp --dport 端口 -j ACCEPT
中止mjpg可以用命令:kill -9 `pidof mjpg_streamer` 地ID就爱哦的浓雾的机器哦红记得请我还定期12
页:
[1]
2