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:[email protected]" -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 ?
Use the -t option to specify a time limit: `-t duration' Restrict the transcoded/captured video sequence to the duration specified in seconds. hh:mm:ss[. xxx] syntax is also supported.
FFmpeg MOV to MP4 (Convert Video/Audio to Another Format) FFmpeg is extremely useful to convert your video file to another format. For example, to convert MOV to MP4 with FFmpeg, run the command below. ffmpeg -i input.mov output.mp4. Similarly, you can transcode audio files with FFmpeg by specifying the output format.
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
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