[FFmpeg-devel] [PATCH] ffmpeg: add 100ms delay for first stats

Gyan Doshi ffmpeg at gyani.pro
Wed Dec 23 12:48:46 EET 2020



On 23-12-2020 04:03 pm, Nicolas George wrote:
> Gyan Doshi (12020-12-23):
>> It's    void av_dump_format(...)
>>
>> Seems too trivial to change it , or add + initialize yet another global
>> variable just for this.
> Exactly. Dumping the output is a global affair, it can warrant a global
> variable. Something like this:
>
>      of->header_written = 1;
>
>      av_dump_format(of->ctx, file_index, of->ctx->url, 1);
> +   output_dumped++;
>
> ...
>
> +   if (output_dumped >= nb_output_files) {
>          ...
> +   }
>
> That way, the initial stat is printed as early as possible, but will not
> mangle the dump. And if the dump is very late, it is acceptable to have
> the 500ms timeout too:
>
> +   if (output_dumped >= nb_output_files || blah >= 500000) {

Ok. Will work on this.

But I still think I should post an immediate fix that handles it for 90% 
of cases.

Thanks,
Gyan


More information about the ffmpeg-devel mailing list