[FFmpeg-devel] [PATCH 2/4] concatdec: factorize duration calculating code to get_duration function

Marton Balint cus at passwd.hu
Mon Nov 9 19:28:31 CET 2015

On Mon, 9 Nov 2015, Nicolas George wrote:

> Le nonidi 19 brumaire, an CCXXIV, Marton Balint a écrit :
>> How do you know if it is reliable/authoritative? Is there a demuxer flag or
>> something like that? Or you mean when the duration is explicitly set by the
>> user or when inpoint and outpoint is both set, therefore the duration can be
>> calculated?
> That is what I call authoritative: even if the script does not hold the real
> duration of the file, the script is considered right.
> The duration is reliable when lavf has reached the end of the file and
> computed the timestamps. In other words, when file->duration is set by the
> current code, then it either authoritative or reliable.

That's okay, and this patch does not change that like the previous 
version, it is factorization only now.

If propagating unreliable duration metadata worries you, then how about 
making the demuxer flag in the next patch a tri-state:
0 - default - dont output metadata
1 - output duration metadata only if duration is authoritative 
(comes from the script) or reliable
2 - always output duration metadata even if it is unreliable and comes 
from AvFormatContext->duration when opening the file.


More information about the ffmpeg-devel mailing list