Specify timestamp in ffmpeg video segment command
ffmpeg
Solution
Appears you need to add the "-f segment" parameter. Here's an example with strftime as well:
ffmpeg -i your_input -f segment -strftime 1 -segment_time 60 -segment_format mp4 out%Y-%m-%d_%H-%M-%S.mp4
segment_time 60 means 60 seconds, strftime 1 means "enable strftime names"
For me this created files with names like this:
`out2015-03-05_10-27-43.mp4`
Problem
I have a continuous RTSP stream coming from a camera over the network. I want to dump the stream but in video files of length 1 min each. I an using the following command ``` ffmpeg -i "rtsp://user:pass@example.com" -f mp4 -r 12 -s 640x480 -ar 44100 \ -ac 1 -segment_time 60 -segment_format mp4 "out%03d.mp4" ``` The name of the files being created are of the form `out001.mp4`, `out002.mp4`, etc. I want to include the timestamp (hour and minute) in the name of the file segments eg. `09-30.mp4`, `09-31.mp4`, etc. If it is mandatory to provide a serial number for the segment, is it possible to get something like `09-30-001.mp4`, `09-31-002`.mp4 ?