Subject: [Cellar] Matroska SeekHead questions

From: Dave Rice <[email-masked]>
Date: Sun, 24 Jan 2016 15:54:43 -0500

Hi all,

The current definition of SeekHead is "Contains the position of other level 1 elements.”

Is it valid to use the SeekHead to reference Elements that are not Level 1?

Is there any existing official text about the use of chained SeekHeads (SeekHeads that link to other SeekHeads)?

In the related section on “Position References” it says: "The position in some elements refers to the position, in octets, from the beginning of an element. The reference is the beginning of the first Segment element (= its position + the size of its ID and size fields).” Since the Segment Element can occur more than one time in an EBML Document I wanted to verify how SeekHead works in Matroska EBML Documents with multiple Segments. For instance in a file structure like:

<EBML>
<Segment>
	<SeekHead/>
	<Info/>
	<SeekHead/>
</Segment>
<Segment>
	<SeekHead/>
</Segment>

So if I understand the definition correctly, the SeekPosition values in all three example <SeekHead> Elements reference the offset from the beginning of the FIRST Segment, correct?

Related to the last question, is there a reason for the Segment element to be multiple. I know an EBML Stream may be <EBML/><Segment/><EBML/><Segment/>, but is <EBML/><Segment/><Segment/><EBML/><Segment/> allowed? If we clarify that the ‘multiple/maxOccurs’ value of Level 0 Elements refers to the occurrence within an EBML Document rather than a file, could the Segment Element be set to non-multiple?

Also SeekHead refers to the other level 1 elements, but is there any issue if the SeekHead only refers to some and not all of the other Level 1 elements?

Dave Rice

---

From: Steve Lhomme <[email-masked]>
Date: Tue, 26 Jan 2016 11:42:42 +0100

> Is it valid to use the SeekHead to reference Elements that are not Level 1?

There's a very good chances no player will use such values. Also
they'd be harder to interpret, since you don't know in which parent
element they belong to.

> So if I understand the definition correctly, the SeekPosition values in all three example <SeekHead> Elements reference the offset from the beginning of the FIRST Segment, correct?

No, multiple concatenated either come different sources or an original
file that was split. In all cases the SeekHead references the Segment
it belongs to. It works even if you don't have the other segments.

> Related to the last question, is there a reason for the Segment element to be multiple. I know an EBML Stream may be <EBML/><Segment/><EBML/><Segment/>, but is <EBML/><Segment/><Segment/><EBML/><Se…

IMO <EBML/><Segment/><Segment/> is not allowed. And such files
probably don't exist. But we may allow it. It's not that different to
parse than when the EBML header is always preceding the Segment.

> Also SeekHead refers to the other level 1 elements, but is there any issue if the SeekHead only refers to some and not all of the other Level 1 elements?

No, it's optional, not a guarantee it contains all the Level 1
elements. We may add a rule that if you add one type of level 1 (eg
Tags) all these elements must be referenced (all Tags found in that
segment). Otherwise it's kinda useless. Also the SeekHead cannot
reference itself...

> Dave Rice
>
> _______________________________________________
> Cellar mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cellar

-- 
Steve Lhomme
Matroska association Chairman