[theora-dev] Theora in Matroska

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Fri Nov 3 12:09:23 PST 2006

Let me see if I understand the problem correctly.

Matroska provides only one header packet per codec to identify it.
Michael's proposal suggests to create a new header for each of our
codecs (well, his proposal is only for vorbis, but there are other
codecs who have secondary header pages)?

I am not sure if Matroska would encapsulate the clean codec stream or
an ogg framed stream. I also don't understand if there would be one
blob per codec in the case of a multitrack file (e.g. Theora + Vorbis)
or whether there would be just one large, interleaved blob. In any
case, I might put our experience into the mix to get this right.

When Skeleton was developed for Ogg, we wanted to have one generic
type of header that could help identify all the possible codecs inside
an Ogg stream and give enough information to an application to seek
without having to decode the secondary header pages. Our first aproach
was to add an additional header before each codec. That was really bad
though, because it broke all the existing Ogg decoders out there and
essentially created a new format.

After lengthy discussions, a much better solution was born: create an
additional logical bitstream that had one header per codec inside it.
This spec is now Skeleton and is supported by just about all the
common media players out there.

May I therefore suggest that if Matroska needs one header per codec,
it could use a Skeleton bitstream to do so (see
http://wiki.xiph.org/index.php/Ogg_Skeleton)? Or maybe at least to use
the fishead headers as a basis for a new spec, since they have gone
through a long thought process in development. Also, it might make it
easier to implement support in media players since most already
support it for Ogg.


On 11/4/06, Ralph Giles <giles at xiph.org> wrote:
> Forgive the cross posting, this affects several projects.
> On Fri, Nov 03, 2006 at 12:50:27AM -0800, Unga wrote:
> > Currently Theora video in Matroska is not supported by
> > Mplayer. To enable the support Michael Niedermayer has
> > made the following proposal sometime back:
> > http://article.gmane.org/gmane.comp.video.mplayer.nut.devel/214
> The proposal is that we add a recommendation to the ogg vorbis
> spec to just concatenate the headers when embedding in a container
> that needs to store them in a blob, and that readers skip leading
> and trailing data based on known packet lengths and magic strings.
> As Michael says, this works, and is just the sort of hacky spec
> wrangling ogg is (in)famous for. :)
> I guess my only comment is that this isn't particularly general.
> While vorbis has a fixed set of header packets with "easy" to determine
> lengths, it's possible to do a codec with external framing in mind where
> this wouldn't work. The theora spec, for example, allows additional
> application-defined header packets after the initial required three.
> It also means a cross-encapsulator has to understand a codec's header
> packet format to put the data in an ogg stream, which is something many
> implementors have complained loudly about. Therefore I'd like to
> counterpropose something with explicit packet lengths, like matroska
> has, or the "packed header" format the vorbis and theora rtp drafts use.
> If we're going to add this to the vorbis and theora specs, I'd like to
> see it used as broadly as possible, but luca dislikes the metadata
> header and omitted it from his packed header design for rtp. Luca, what
> do you think about adding the metadata header back as an optionally
> empty field?
>  -r
> _______________________________________________
> theora-dev mailing list
> theora-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/theora-dev

More information about the theora-dev mailing list