[FFmpeg-user] Re-writing hot .ts file that rotates every 24 hours in realtime

Moritz Barsnick barsnick at gmx.net
Sat Feb 20 01:13:54 EET 2021


On Wed, Feb 17, 2021 at 22:18:00 -0800, Carl Zwanzig wrote:
> On 2/15/2021 11:33 PM, Korn Moffle wrote:
> > What I am trying to do:
> > a. copy the file in realtime ? So, ffmpeg would be rewriting file1.ts into file2.ts as file1.ts is constantly being written into.
>
> What's the goal of that?

I think he may be trying to tell us he wants to process the data
created by the first ffmpeg in realtime?
>
> > b. tell ffmpeg to read the file with a constant 3 second delay from the most updated frame?
>
> ...to add a 3 second delay?

Perhaps to avoid reading beyond the end of the file?

It sound to me as the first process is constantly recording a stream
straight to disk, and shall turn around to the next file after a
certain time. The second process reads these files while they are being
created, and does something else.

This sound a lot live HLS live streaming. The first process creates a
dynamic .m3u8 with segments, the second process knows how to read
these in real time. It even uses MPEG-TS underneath by default.

Have a look at the "hls" muxer (and demuxer).

Cheers,
Moritz


More information about the ffmpeg-user mailing list