Opened 13 years ago

Closed 12 years ago

#26 closed enhancement (fixed)

Switch to record/split to multiple files on the fly

Reported by: Sebastian Owned by: Michael Niedermayer
Priority: wish Component: avformat
Version: git-master Keywords: segment
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


It would be really nice if there was another command line switch/parameter for splitting/recording to multiple files on the fly. Something like the existing -t switch, but instead of recording, say, 10 minutes and then stopping, it would be nice to record 10 minutes, and then create a new file. This will obviously have to take some arguments for designating the file names automatically - either incrementally (video01.avi, video02.avi, video03.avi) - either based on the time of recording start (10:22_video.avi, 10:32_video.avi, 10:42_video.avi etc.). Or the output file name argument parsing could be modified to parse time/date based switches.

This would be very useful specially for something like a cctv application, where recording tends to be done in 10 minutes segments - but there probably are other circumstances which will benefit from this.

At the moment I use the -t switch and a loop in a bash script - but a dedicated option/command line switch for ffmpeg would be far more elegant.

Change History (2)

comment:1 by Carl Eugen Hoyos, 13 years ago

Priority: normalwish
Status: newopen

I wonder if this can be done for all output formats (and all protocols) in a useful way and how the overhead on writing indexes, closing one file and opening another should be handled.

comment:2 by Carl Eugen Hoyos, 12 years ago

Component: FFmpegavformat
Keywords: based recording on the fly splitting removed
Resolution: fixed
Status: openclosed
Version: gitgit-master

This has been implemented by Luca as -f segment, works fine with -segment_format mpegts (needs -flags -global_header for h264), see ffmpeg -h for the other segment options.

Note: See TracTickets for help on using tickets.