Skip to content

MKV – Matroska support… researching

December 5, 2012

I’ve been researching what it would take to get to get MKV support in Simple TV Library.  This may be helpful to know so that app makers in general are not blamed too much when an app does NOT support MKV or codec X.  Windows Store app (formerly known as Metro apps) do NOT use any of the codecs installed on your PC.  These are DirectShow codecs and it is the older system for decoding video/audio.  It’s in heavy use still because XP is still around as well as the fact that everyone knows how to program with DirectShow.  When Vista was introduced, a new system called Windows Media Foundation was also released.  This is essentially what Windows Media Center uses (although I believe there are hacks to get it to use DirectShow).

In any case, Media Foundation is in Windows 7 and now in Windows 8.  Windows Store apps can ONLY use Media Foundation to decode video and audio.  Otherwise, you are limited to the basic MediaElement control… which is excellent!  However, it only supports a limited number of container formats and video/audio codecs.

Matroska is a container format, like an AVI file.  Inside that MKV file, there might be a video stream encoded with H264 which Media Foundation can read natively.  If there’s a non-standard stream inside that MKV file, like an Ogg Vorbis audio stream.  Then you’d also need a codec to play the Ogg Vorbis audio.

The other caveat here is that even if someone were to write an MKV “codec” for windows desktop, it WON’T work with a Windows Store app.  The MKV software must be written into the app itself.  It is the nature of these Windows Store apps that they can ONLY use the WinRT libraries on your machine.  Any other library must come with the app itself.


My goal right now is to figure out how to have Media Foundation open the MKV container and access the streams inside.  That’s it.  That would mean many of the MKV files available would work since they contain H264 and mp3 streams.  It’s incredibly difficult to do it though.  First, there are not many great samples to look at.  Second, there is not much literature about Media Foundation.  Third, it’s all in C++ which is not my forte.  But I’m going to try anyways.  There are possible wrappers I could use (MF.NET or SharpDX), but I still need a solid understanding of how Media Foundation works…

So that’s what I’ll be doing over the holidays.  I’ve got one more final to give tomorrow then a bunch of grading.  But then I have a few weeks to work on MKV and media foundation.  Wish me luck 🙂


From → Matroska

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: