матрёшка / matroska

English Deutsch Français 日本語 Español Português Русский Nederlands Italiano
Matroska Logo
Matroska Logo

Matroska FAQ

Q: What is matroska ? I dont understand what a 'container format' is at all, is it a player, or a audio/video compression format ?

A: whenever you play a movie on your PC, without even noticing it, you are always playing at least one video stream and one audio stream at the same time. As it is not very practible to have to handle 2 different files for that, lets say an MP3 audio file and another file containing the video, you pack both into a single file by using a so-called container format file, comparable to a ZIP file. This container and the software coming with it take care of a lot of important functions, like the correct timing of the audio and video playback when the file is played ( opened ). ZIP or RAR could be a perfect container to pack one or more audio/video streams together into one single file for distribution, but WinZIP certainly wouldnt care about the correct timing of the these streams on playback ...
Known containers are the good old AVI ( most DivX movies you will get will have an .avi extension ), or the MPEG container ( .mpg , .mpeg ), Quicktime ( .mov ), Realmedia ( .rm ), MP4 ( .mp4 ), etc. .
The matroska project is a free, opensource alternative to all of them, and aiming to be able to offer a lot of features that others dont have have ( look at our homepage again ).

Q: Ok, now i know what a container is, but what exactly are the advantages of matroska compared to good old AVI ?

A: The AVI container was originally introduced by Microsoft in the early 90s, and was designed as a very flexible A/V container format for the video and audio compression formats of those days. It is necessary to understand that AVI is only one ( but important ) part of a complete multimedia framework called 'Video For Windows' ( VfW ), offering programmers not only a container but also a complete set of API commands to be able to program their own video and audio codecs, using either the VfW or the ACM interface ( this was back from the days when Microsoft was still dedicated to sell their operating systems to people, instead of multimedia solutions as they are trying to do today with WMV, so they had to make their OS attractive to other programmers ).
Very unfortunately this VfW framework cannot support many of the more advanced features that modern audio and video compression formats will offer, such as Variable Bitrate audio encoding ( VBR ), or Variable Framerate video encoding ( VFR ). Although AVI was extended with an additional standard called 'Open DML AVI' in the mid/late 90s, overcoming most of its very annoying limitations like the 2 GB file size limit, there is still no proper and spec compliant way to support modern compression formats like the excellent, opensource Ogg Vorbis audio compression format.
matroska is overcoming all these limitations and can support all known audio and video compression formats by design. To make sure it will also be capable of coping with the future standards it is based on a very flexible underlying framework called EBML, allowing to add more functionalities to the container format without breaking backwards compatibility with older software and files.


Q: What extensions is matroska using ?

A: We currently have 3 different extensions specified :

- .mkv : Generally video files, as well those containing audio ( movies ) or video only
- .mka : audio only files, can contain any supported audio compresion format, such as MP2, MP3, Vorbis, AAC, AC3, DTS, PCM and soon MPC ( musepack )
- .mks : a so called 'elementary' matroska stream containing any subtitles stream


Q: How can i create matroska files ?

A: The easiest way would be to 'transmux' an existing AVI or OGM file. This is a lossless process, all the audio and video data in the source file will be read from it, and packed into a matroska file in a spec compliant way, but basically stay unaltered to avoid any degradation of quality. There are currently 2 different tools to do this ( look here for the announcement of their latest versions ), but the list is ( hopefully ) steadily growing. In VirtuldubMod ( starting from 1.5.1.1a ) all you have to do is to open your AVI or OGM file, set 'video' to 'direct stream copy', goto 'file' 'save as ...' and select '.mkv' from the file type dropdown list and rename it. Of course, this doesnt make much sense if you dont have any plans to add something to the file that AVI or OGM cannot support, like adding another audio track in an unsupported audio compression format.
Mosu's mkvmerger is a command line based matroska muxer that can be run on Windows ( via cygwin.dll ) and Linux, it also does accept AVI and OGM on its input, as well as AC3, AAC, Vorbis, DTS, MP3, MP2 and PCM audio.
From VirtualdubMod you can also directly encode into .mkv files from any source that it can open, and using every available VfW and ACM codecs, even in 2 pass mode ( from VdubMod 1.5.1.2 ).


Q: How can i play matroska files on my PC ?

A: On the download page you will always find the link to the very latest DirectShow parser filter, that way you will be able to play your .mkv files on Microsoft Windows with every DirectShow based player such as Windows Mediaplayer (6.4/7/8/9), Zoomplayer and BSplayer. The best playback support from Windows is currently achieved with The Core Media Player, if the matroska CDL plugin was used.
For Linux PCs, as well as for MacOSX and the X-Box emulation you have to get the newest version of mplayer, and make sure to have a compilation that will include libebml and libmatroska. Suitable RPMs are available from Mosu's mkvtoolnix site.


Q: What is the advantage of using the .mka file instead of the original audio formats, like mp2, mp3 etc?

A: In many cases there is not a reason to store audio only files in MKA. If you have an audio file with a single track, or "song", that you don't intend to edit, then there generally isn't a very good reason to place it in MKA. For instance, you have a song by Metallica in MP3, and you have all of the info filled out in ID3v2.4 tags. There is little reason to place it in Matroska, and it would add a little overhead.
But, here are some reasons that placing audio in MKA is useful:
1. The tags will be the same no matter what audio format you use. That means that if you write a program to read back tags, it only has to read them from one type of tagging system, no matter what type of audio is being used.
2. All tracks to a CD can be in a single file. You have the option of dividing the tracks into seperate Tracks, or seperate Chapters. You could make your own compilation in a single file, even using different audio formats, such as MP3 and Vorbis.
3. If you write a program to read audio of of MKA, then you don't need to understand how the framing works in the different formats because it is already done for you in Matroska.
4. It is easy to delete portions of the audio without reencoding because you just throw away those blocks. You don't even have to be able to play that format back, you could edit by just knowing timecodes.
5. Detecting differences between two audio streams would be easy because you could store both in a single file, start playback, and then just switch between tracks.
6. If you intend to combine the audio with video, then having is in MKA means you can merge it with an MKV, even if the application doesn't support the audio type.


Q: will my .mkv files be compatible with future Matroska software if i will use current (beta) tools to mux my files?

A: The files being created now are spec compliant. Just do not create tags using the Tags CDL(Core Dynamic Library) for TCMP The tags specs are not frozen yet, so some of the tags may not be valid.


Q: will there be a perfomance hit for storing audio/video in Matroska?

A: We knew from the start that Matroska would require more CPU time to read/write than AVI because it has a more complex design. However, we were not sure how much this would be. As it turns out, it is completely unnoticeable. You can't tell a difference when reading back a file from AVI or MKV on today's processors. Writing currently takes much more, but that is mostly because time is needed to refine the writing apps for MKV.

Q: What makes Matroska better (worse?) than an ogg media container (.ogm)?

A: It's less a matter of better/worse, and more a matter of different. This is a little complex and is broken up into a few sections. First Ogg is not the same thing as Ogm.
Ogg was designed to stream audio, specifically Vorbis. Ogg was not designed to handle video, or any other type of audio. (Though their use is not prevented in the Ogg specs, it is not specifically supported either) Ogg is an RFC spec now, and is very useful for what it was designed for, streaming Vorbis. There were never any Ogg or Vorbis DirectShow filters released by Xiph, which is a huge shame.
Ogm is an implementation of placing other 'things' in Ogg by a very smart man named Tobias. It is not (yet) supported by Xiph. Tobias more or less joined the Xiph team through a series of events that I will not repeat. There are no official specs. The sources will be released as open source, but they have been scheduled to do so for almost six months. If Xiph does decide to use part of OGM, they are likely to change the specs to some extent. They have already said that they intend to maintain support of old OGM files in their new filters (whenever those are released).
So, we have:
Ogg
1. Designed for streaming.
2. Designed to hold Vorbis.
3. Well documented for above two purposes.
Ogm
1. Implementation of Ogg to hold video, other audio codecs, and a type of subtitle.
2. Implements Chapter support.
Matroska
1. Designed to hold any type of codec. (Audio, Video, Subtitle, etc)
2. Designed for editability.
3. Purposely flexible design.
4. Well documented portions, others in process.
5. Initial design is to support presentation container features such as Chapters, Tags, AudioGain, Menus, etc.
Will Matroska be streamable? Yes, but low bitrate streaming like streaming Vorbis, will always be better in Ogg. This is because their design is for different purposes.