[FFmpeg-user] Hardening ffmpeg stream download?

Bo Berglund bo.berglund at gmail.com
Thu Jun 9 20:25:14 EEST 2022

On Thu, 9 Jun 2022 16:26:44 +0000, Carl Zwanzig <cpz at tuunq.com> wrote:

>On 6/9/2022 9:16 AM, Bo Berglund wrote:
>> Or if it is impossible given the output file format, is there some other format
>> that can be used to harden the download?
>mp4 files must be "finalized" so aren't a good choice for an application 
>which might be interrupted. If the download is an mpeg stream (probably, is 
>it?), record that then post-process into an mp4. That'll take up more space 
>but you recover that after the re-coding.

OK, that was what I suspected...

Is there some way to let ffmpeg write the mpeg or ts stream to disk and then
immediately feed it to itself as an input to create the mp4?
The data rate of the stream is not overly fast so there is probably time
available to do this re-encoding "on the fly" such that the final file will be
ready at more or less the same time as the timeout expires.

But I don't know how to formulate such a call to ffmpeg...

By the way I forgot to say that the downloads happen on an HP PRODesk Ubuntu
20.04.4 server with 250/250 fiber access to the internet and pretty good
hardware too.
The downloads are partitioned into 65 minute chunks, which ends up as about 220
Mbytes file size now with the command shown in my start post.

Bo Berglund
Developer in Sweden

More information about the ffmpeg-user mailing list