我试图制作一个bash脚本,从ip摄像头抓取静止镜头而不是通过电子邮件发送它.
使用ffmpeg -i http:// admin:Stupidpassword1@10.12.10.40/Streaming/channels/1/picture -f image2 -updatefirst 1 doorbell.jpg从我所看到的应该可以工作但是输出文件名仍然是doorbell.jpg如何创建文件名TIMESTAMPdoorbell.jpg?
Bri*_*ian 11
使用"strftime"功能:
ffmpeg -i http://admin:Stupidpassword1@10.12.10.40/Streaming/channels/1/picture -vframes 1 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S_doorbell.jpg"
Run Code Online (Sandbox Code Playgroud)
"-vframes 1"将使其仅处理它接收的第一帧.
您可以使用strftime兼容字符串更改日期/时间格式:http: //man7.org/linux/man-pages/man3/strftime.3.html
进一步的文档/示例:https: //www.ffmpeg.org/ffmpeg-formats.html#image2-2