DiracInMatroska

From Diracvideo

Jump to: navigation, search

[edit] Dirac In Matroska (DRAFT)

Matroska spec: http://www.matroska.org/technical/specs/index.html

Dirac spec: http://dirac.sourceforge.net/specification.html

[edit] Implementation

  • The codec identifier in Matroska is "V_DIRAC"
  • A Dirac stream consists of 4 different packet types: pictures, sequence headers, auxiliary data and padding. Auxiliary data and sequence headers are associated with the picture packet that is following directly afterwards. As such a Matroska block will contain every packet until (and including) a picture to make sure everything associated with the picture is stored next to it. See the Dirac spec (v2.2 chapter 9) for more details.
  • The Matroska Track element should contain the video width/height, aspect ratio, fps, etc but demuxers must not change the Dirac stream if the values from the Track element and the Dirac frames are different. The values can be read from the sequence header, see the Dirac spec (v2.2 chapter 10) for more details.

[edit] Reference frames

As a sequence header is required before any decoding can happen and as encoders are usually prepending sequence headers before frames, that could work as seek points, the following should be done for marking frames as key frames and settings their references:

  • A block that contains a sequence header is a "key frame", ReferenceBlock is NOT set for this block
  • A block that doesn't contain a sequence header is NOT a "key frame". ReferenceBlock must point to the previous block.

While this mode is not technically correct it works and is not too hard to implement. Demuxers should start output only at blocks that contain a sequence header. This simple mode can use SimpleBlocks and normal Blocks.

A technically correct setting of reference blocks is not feasable as it's far too complex and won't help much when decoding as Dirac decoders wants all frames in coding order without any gaps.


Personal tools