[FFmpeg-devel] Why the tag “DURATION” is a necessity in Matroska files?

21naown at gmail.com 21naown at gmail.com
Mon Jun 19 03:04:08 EEST 2017

Le 18/06/2017 à 00:57, Sasi Inguva a écrit :
> Hi,
> I was the one who made that change. We needed a way to obtain individual
> stream durations from a  Matroska file without reading the entire file. I
> don't think it adds to the file size greatly (< 50 bytes) compared to the
> size of video and audio data, hence I didn't hide it under an option.
> However if u really need it I can add an option.
> On Jun 16, 2017 7:21 AM, <21naown at gmail.com> wrote:
> Le 16/06/2017 à 16:04, wm4 a écrit :
>> On Fri, 16 Jun 2017 15:43:51 +0200
>> 21naown at gmail.com wrote:
>> Le 16/06/2017 à 14:25, wm4 a écrit :
>>>> On Fri, 16 Jun 2017 13:51:20 +0200
>>>> 21naown at gmail.com wrote:
>>>>> Le 16/06/2017 à 12:55, wm4 a écrit :
>>>>>> On Fri, 16 Jun 2017 02:32:10 +0200
>>>>>> 21naown at gmail.com wrote:
>>>>>>> Hello,
>>>>>>> I would like to know why the tag “DURATION” in Matroska files (.mkv)
>>>>>>> is
>>>>>>> a necessity? Even mkvmerge lets the choice to use it or not with
>>>>>>> “--enable-durations”, in addition it is written “Write durations for
>>>>>>> all
>>>>>>> blocks. This will increase file size and does not offer any additional
>>>>>>> value for players at the moment.” (source
>>>>>>> https://mkvtoolnix.download/doc/mkvmerge.html#d4e535).
>>>>>>> Possibly linked to
>>>>>>> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=3185254
>>>>>>> 0d4fba0c4e8a16d0b3ddff08fc98e48fd
>>>>>> As far as I'm aware, the linked commit does not do the same thing as
>>>>>> the mkvmerge option you pointed out.
>>>>> Yes that is why I wrote “possibly”, also because this commit is the one
>>>>> which adds the tag “DURATION” as a necessity, but a necessity that no
>>>>> software seems to use and it is not even a standard in the Matroska’s
>>>>> documentation if I am not mistaken. So the fact that it is a necessity
>>>>> and not a choice is the main problem.
>>>> Who says it's a necessity or standard? It's just what mkvmerge does.
>>>> Since the patch is by google, I assume google has some use for it
>>>> (there might also be a discussion about it on the ML).
>>> Sorry for the bad word “necessity”, it is better with “imposed”. Could
>>> you let the choice to the user like mkvmerge with
>>> “--disable-track-statistics-tags”?
>> We could add a private option to the ffmpeg matroska muxer to disable
>> writing this tag, and we could even switch that option off by default
>> (so the tag isn't written unless the user explicitly requests it). Feel
>> free to propose a patch.
> I do not have the capacity for the moment to write patches for such a
> software but what you have written is exactly what I would like.
> I can create a bug report if needed.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Yes the size required for the tag “DURATION” is insignificant, but it is 
preferable to have a choice with this tag like mkvmerge partially does 
(because by default “--enable-durations” is enabled, maybe because it is 
a part of “statistics-tags”, but we can disable them with 
“--disable-track-statistics-tags”) and because the end user and his 
software do not require it.

Yes if you can move the tag “DURATION” as an optional tag—so an argument 
is needed to enable it, I will be grateful to you.

More information about the ffmpeg-devel mailing list