Exploring Matroska: A Container For All Formats

November 8th, 2008   Filed Under Home Entertainment, Home Video, Music and Audio  

In 2003, when I first got serious about digital video, I started seeing some very knowledgeable people making references to an open source container (AV file format) called Matroska. At that time Matroska was very much in its infancy and much of the discussion revolved around the idea of emulating the the programming and menus found on DVDs. At least that was the focus of the comments I read. At the time I was just starting to understand DVD technology and didn’t see any need for it.

Saying I was wrong would be an understatement. What I didn’t undesrtand then, which has become clear to me since, is that a format like Matroska represents a future for home video where consumers have the latitude to get the features they want. Until that happens we’re stuck with whatever movie studio heads and CEOs of electronics manufacturers see as the biggest money maker.

Why We Need An Open Source Alternative

To understand what’s so revolutionary about Matroska you need to start by looking at the mainstream alternatives. You may already be familiar with some of them, including Microsoft’s AVI (Audio Video Interleave) which is used primarily for MPEG-4 formats like DixX and XviD and the miniDV digital camcorder format. You’ve almost certainly been exposed to the MPEG-2 PS format with uses ranging from VCD and SVCD to DVD and the typical MPEG (.MPEG or .MPG) computer files. Then there’s the MPEG-2 TS format used for digital television and Blu-ray and the newer MP4 container designed for MPEG-4 video and audio.

So what’s wrong with these formats? Actually nothing. The problem isn’t that they don’t do what they were designed to do. It’s that they’re not well suited for formats and applications. For example, any of the MPEG formats, MPEG-2 PS (Program Stream), MPEG-2 TS (Transport Stream), or MP4 are designed with specific types of audio in mind. Although they also include the concept of ‘foreign streams,’ which are non-MPEG formats like Dolby Digital and DTS audio.

Matroska, on the other hand, is completely format agnostic. That means you can play any audio or video format from a Matroska file as long as you have the necessary decoder. To see this in action you need only look at the current trend in TV captures. DTV streams typically include MPEG-2 video and AC3 (Dolby Digital) audio. Due to the amount of hard drive space taken by the video it’s common to see it transcoded to a more efficient standard like AVC. Since Dolby Digital audio is already highly compressed many people feel the small efficiency gain from transcoding to another format like MP3 isn’t worth the quality loss.

Once the video is transcoded there’s one last issue to deal with. What container should it be put in? You could use the MPEG-2 TS container it was broadcast in but that doesn’t make a lot of sense. The same features that make transport streams good for DTV, robust error correction and the ability to store multiple channels in one signal, mean additional overhead that’s unnecessary and undesirable if file size is a consideration.

Looking at the other available alternatives, and considering AVC is an MPEG-4 standard, it makes sense to put the finished product in a MP4 file. Now we run into big problems. In theory this should work fine because AC3 audio can be used as a foreign stream. In reality there are two issues. Since the standard audio format for MP4 files is the MPEG-4 standard of AAC it’s difficult to find software that supports Dolby Digital in MP4. If you happen to overcome that problem you’ll find that equally few media players will be able to read it. In fact you’ll be hard pressed to find software that can even extract AC3 audio from a MP4 file.

Matroska To The Rescue

Enter Matroska. Since there is no official audio or video format specified for Matroska, AVC video with AC3 audio works just as well as any other combination. And if you do some searching on the internet you’ll find that this is exactly what many people are doing. After several years of development Matroska has come into its own, but not because it does something new or revolutionary. On the contrary, it’s because it does something obvious that the “experts” charged with developing new technology have overlooked.

For all its success Matroska still has one major hurdle to clear. While it’s gaining widespread support in the computer world, the same can’t be said for consumer electronics. If you happen to use a media center computer or HTPC this isn’t a problem. But if you’re among the majority of the population who uses a DVD player instead you’re out of luck. As is often the case in the world of home entertainment, support for what consumers prefer has taken a back seat to supporting what content producers think is best.

If you want to see Matroska succeed the most important thing is to use it. The more people do that, the closer we get to making it a mainstream format. If you haven’t already, I recommend taking a look at Matroska. You can find basic instructions for creating Matroska files in my guide on the subject. For help playing MKV or MKA files take a look at my guides on Haali Media Splitter and ffdshow.