[Matroska-devel] Tagging MKV files

Dan Hinsley danhi at cox.net
Sat Sep 1 22:25:00 CEST 2012

OK, here's what I did, and what I got.

I copied the data for the SeekHead to the end of the file
I created a new SeekHead with one Seek that points to the old SeekHead at
the end of the file
I created a void to take up the rest of the space from the original

Now this file still plays, but when I run mkvalidator it tells me:

WRN103: Unnecessary secondary SeekHead was found at 39474091
WRN861: The SegmentInfo is not referenced in the main SeekHead
WRN861: The TrackInfo is not referenced in the main SeekHead
WRN861: The Cues is not referenced in the main SeekHead
WRN861: The Tags is not referenced in the main SeekHead
WRN861: The Attachments is not referenced in the main SeekHead

And it also can't find the tag info.

So it seems that having one SeekHead point to another isn't really valid?

Then I tried turning the entire original SeekHead into a Void and copying
the new one at the end of the
file, but then I'm going to have to redo the offsets.  Now there is a
Segment Info (which is also a Level 1) after the new created void, is that
what I'd calculate the offsets from?  But I really don't want to do this,
I'd prefer the original where I created a SeekHead that points to another
SeekHead, but that doesn't seem to be working.

My overall ambition in this is to be able to tag an MKV file without having
to rewrite the entire file (not to mention recalculate every offset along
the way).

I'd really appreciate any insights that might help.


-----Original Message-----
From: matroska-devel-bounces at lists.matroska.org
[mailto:matroska-devel-bounces at lists.matroska.org] On Behalf Of Moritz
Sent: Saturday, September 01, 2012 11:15 AM
To: Discussion about the current and future development of Matroska
Subject: Re: [Matroska-devel] Tagging MKV files


On Sat, Sep 1, 2012 at 7:47 PM, Dan Hinsley <danhi at cox.net> wrote:

> OK, just one more question (for now), the spec says that the offset is
> the FIRST level 1 element, which in the examples I'm looking at is the
> seekhead, but is this always the case or do I need to keep track of the
> first level 1 element no matter what it is?

Huh, I never noticed that exact wording. But what I've described is
more in the spirit of what was meant. The specs simply assume that the
first level 1 element inside a segment is also located directly at the
data start position -- that there are no "gaps" in the form of 0x00
bytes. However, we should change the spec, I guess, as it is a bit

Kind regards,
Matroska-devel mailing list
Matroska-devel at lists.matroska.org
Read Matroska-Devel on GMane:

More information about the Matroska-devel mailing list