[Fwd: Re: [Matroska-devel] Dirac mapping for Matroska]

David Schleef ds at schleef.org
Sat Mar 29 00:24:45 CET 2008

[Finally got back to this subproject]

> Here are a couple of thoughts and questions that occured to me when I
> took a look at that file.
> 1. Sequence headers. In Matroska each block should contain actual image
> data, not just sequence headers. At the moment you write two blocks with
> the same timestamp, one for the sequence header, one for the actual
> frame:
> I frame, track 1, timecode 9600 (00:00:09.600), size 25, adler 0x473d071c
> I frame, track 1, timecode 9600 (00:00:09.600), size 8582, adler 0xf754c179
> This should be handled like it is for other video codecs: the sequence
> headers and the actual video frame in a single Matroska block.

Makes sense.

> 2. Frame types. At the moment you don't write any backward/forward
> reference and therefore all frames are considered to be "I" frames ("I"
> in the loosest sense of the word, meaning that you don't need any other
> frame before you can decode this one).

I'll blame this on GStreamer's matroskamux.

> So what kind of frame types does Dirac know? Can you ONLY start decoding
> at a frame right after a sequence header? Or are there frames for which
> there are no sequence headers directly in front of them? Is something
> like this possible (I = I frame, s = sequence header, n = non-I-frame):
> sInnInnnnnInnsI...

Yes, this is possible and happens occasionally.

You can only start decoding at a sequence header.  At the moment, the
picture immediately following a sequence header will be an I picture, and
all subsequent pictures in presentation order (but not coding order) are

It is likely that this will be relaxed somewhat in a future version to
allow P pictures immediately following sequence headers, with a
requirement on the stream that the decoder must be able to present clean
pictures after decoding N pictures.

> 3. The very start of the stream actually contains three Matroska blocks
> for the same timestamp:
> I frame, track 1, timecode 0 (00:00:00.000), size 34, adler 0x75650798
> I frame, track 1, timecode 0 (00:00:00.000), size 25, adler 0x3bf5063f
> I frame, track 1, timecode 0 (00:00:00.000), size 8549, adler 0x55699322
> I guess that one's a sequence header, the last one is the actual video
> frame, but what's the other?

It's an auxiliary packet containing the name and version of the encoder.

> Is that some kind of data that would better
> be located in the CodecPrivate element (at the moment there isn't one)?

Unlikely.  It would best be parsed and placed in an appropriate field
in container data.  (Not familiar enough with matroska to say where, but
I assume it has this.)  In general, though, auxiliary packets can be
dropped with no loss.

There are potentially other auxiliary packets of interest.  See


More information about the Matroska-devel mailing list