[MPlayer-dev-eng] Re: video application developer meeting

Adam Rice adamrice at ntlworld.com
Thu Dec 25 04:33:50 CET 2003

Quoting D Richard Felker III (dalias at aerifal.cx):
> BTW2, after seeing demux_mkv.cpp being OVER 3500 LINES (!!) with OVER
> TWENTY INCLUDED HEADERS, I am more convinced than ever that Matroska
> is horrible... Keep in mind that NUT is superior in every way (from a
> technical standpoint) and only takes a couple hundred lines to
> implement.

I don't know anything about a/v container formats, but I do know about XML,
and reading that Matroska is based on a binary XML format raised a red flag
for me. In a previous life I worked on a system that processed a LOT of XML
and so spent a lot of time pondering the question "why is this so damn slow?".
The instinctive answer for people from a microcomputing background is "because
it's text", but actually text is about the most optimisable thing there is.
The thing you can't optimise is that XML forces you to parse your data in a
hierarchical fashion, even if it is in fact completely flat. It's costly in
terms of RAM, and very costly in terms of code complexity. If you throw away
the dream of parsing general XML, and place strict restrictions on your input,
effectively hammering it flat, you can get the speed back, but the resulting
code is usually temperamental.

I don't know if performance even matters for an a/v container format, but if
ever there was a format that needed to be flat, that's gotta be it. Of course,
it's desirable to be able to expose streams and sub-streams to the user, but
that's essentially meta-information.


Adam Rice -- adamrice at ntlworld.com -- Blackburn, Lancashire, England

More information about the MPlayer-dev-eng mailing list