I'm trying to make a bash script that grabs a still shot from an IP camera and than emails it.
Using
ffmpeg -i http://admin:[email protected]/Streaming/channels/1/picture \
-f image2 -updatefirst 1 doorbell.jpg
From what I have read this should work but the output file name is still doorbell.jpg
How can I make the filename TIMESTAMPdoorbell.jpg
?
Use the "strftime" feature:
ffmpeg -i http://admin:[email protected]/Streaming/channels/1/picture -vframes 1 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S_doorbell.jpg"
"-vframes 1" will cause it to only process the first frame that it receives.
You can change the date/time format using a strftime compatible string: http://man7.org/linux/man-pages/man3/strftime.3.html
Further documentation/examples: https://www.ffmpeg.org/ffmpeg-formats.html#image2-2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With