[Matroska-devel] Several (minor) issues or underspecified areas in the MKV spec

Michael Bradshaw mjbshaw at google.com
Tue Oct 6 15:49:48 CEST 2015

On Mon, Oct 5, 2015 at 10:15 AM, Dave Rice <dave at dericed.com> wrote:
> On Oct 5, 2015, at 12:47 PM, Michael Bradshaw <mjbshaw at google.com> wrote:
>    - How should a EBMLMaxSizeLength > 8 be handled if it occurs after the
>    element that needs it (specific edge case: DocType has a size length of 9,
>    but DocType occurs before EBMLMaxSizeLength in the header; how should that
>    be handled?) (alternate edge case: a Void element occurring in (or before)
>    an EBML element with a size length is > 8 and occurring
>    before EBMLMaxSizeLength). Should the spec explicitly require parsers to
>    parse as if EBMLMaxSizeLength is 8 unless and until explicitly told
>    otherwise?
> Maybe the documentation for EBMLMaxSizeLength should be clarified
> as EBMLMaxSizeLength=8 does not mean that the payload of the EBML elements
> is limited to 8 bytes, it means that the size value of the EBML Element
> itself is restricted to 8 bytes. I believe that an 8 byte size statement
> provides something like 72 petabytes. I hope there are no docTypes greater
> than 72 petabytes in length ;).

Yeah, I know EBMLMaxSizeLength refers to the length (in bytes) of the size
value, and this is where some of that "extremely unlikely to happen but
still in the realm of possible" applies :). That said, since the size isn't
required to be trimmed of unnecessary leading bytes (i.e. "5 can be coded
0x000000000005 or 0x0005 or 0x05"), it's totally permissible for the
encoder to set EBMLMaxSizeLength=10 and have some sizes that use all 10
bytes, even if the values they store could easily fit in fewer than 8
bytes. For files like these, I think it's worth clarifying this part of the

>    - The EBML spec says that the Reserved ID (all bits set to 1) is the
>    only ID that may change the Length Descriptor (the count of leading zeroes
>    + 1). What exactly does it mean to "change the Length Descriptor?" Does
>    this mean a Length Descriptor can be > 4 (even if EBMLMaxIDLength = 4) iff
>    the ID is the Reserved ID?
> Good question, though I'm not sure the answer, this is an older part of
> the EBML spec that pre-dates my work on it. Some related discussions on
> this are here: https://github.com/Matroska-Org/ebml-specification/pull/15

Who would be good to ask for clarification? If we can't figure out exactly
what it means, would it make more sense to just remove it from the spec?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.matroska.org/pipermail/matroska-devel/attachments/20151006/d56c82ea/attachment.html>

More information about the Matroska-devel mailing list