[FFmpeg-user] Change output file at specific time

Andrey Utkin andrey.krieger.utkin at gmail.com
Fri Dec 6 18:40:50 CET 2013


2013/12/6  <frafart at free.fr>:
> Hi,
>
> I try to generate 5 minutes long TS file's from an udp streams. I can do it with segment (the accuracy is not very high but it works and I don't have really work on all the segment options).
> My problem is : I want that the file rotate at specific time (at 00:00:00, 00:05:00, 00:05:10, ...).

You could capture the stream with simpler tool, like netcat or socat,
killing and restarting it when needed. The loss of data during restart
should be merely noticeable.

> Is there a way with ffmpeg to specify not a duration but, for exemple an test like timestamp % 300 = 0 ?

At command line level - no. You can do anything you want in
application using libavformat API.

> Another question : Can I use an extended pattern for the file name (%H for hours, %M for minute, ...) ?

You can do that by bash, not ffmpeg functionality.

-- 
Andrey Utkin


More information about the ffmpeg-user mailing list