Opened 5 years ago

Closed 5 years ago

#26 closed enhancement (fixed)

Switch to record/split to multiple files on the fly

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

Description

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 Changed 5 years ago by cehoyos

  • Priority changed from normal to wish
  • Status changed from new to open

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 Changed 5 years ago by cehoyos

  • Component changed from FFmpeg to avformat
  • Keywords based recording on the fly splitting removed
  • Resolution set to fixed
  • Status changed from open to closed
  • Version changed from git to git-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.