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

Michael Glenn Williams michael.glenn.williams at smartblondeco.com
Sat Feb 20 21:05:44 EET 2021


Hi Korn,


> 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.
>
OK, so we need to create a connection between ffmpeg and file 1 that will
not return EOF, and will block if there is no data. Something like using
stdin instead of reading the file directly. I'm not a windows programmer
but this seems to do what you need:
https://docs.microsoft.com/en-us/windows/win32/procthread/creating-a-child-process-with-redirected-input-and-output


> b. tell ffmpeg to read the file with a constant 3 second delay from the
> most updated frame?
>
Read works by how much you request to read. You can certainly create a
timer loop that requests an amount of data after 3 seconds, then waits to
read for another 3 secs.


> c. if a new file appears, detect it and switch to it?
>
When we say a new file appears, do we mean that file1.ts gets overwritten
with a new file1.ts ?

>


More information about the ffmpeg-user mailing list