Converting MKV to WTV
Windows 7 was a big step forward for acceptance of certain codecs and containers by Microsoft. Prior to the release, Media Center users had a lot of issues getting their movie files to play on extenders. Even AVI wasn’t supported within the extender UI basically locking you down to some very difficult to obtain formats. Windows 7 changed most of that. The AVI container became supported as well as several other popular file formats. One that was left out however was MKV.
Seen by some as nothing more than a container used to pirate movies, the Matroska Multimedia Container is an open standard free container format that can hold, well basically anything. A single file can contain an unlimited number of video, audio and subtitle streams. This makes it extremely versatile. Microsoft has ignored it however, more than likely due to what I mentioned above about piracy. There are literally thousands of movies available online in this format.
So what’s a Media Center user to do? You have several options and even one that will get the MKV container to play on your extenders. None of these are perfect however. I’ve had issues using the Divx solution as certain files wouldn’t play. Just installing a splitter on your HTPC isn’t going to help the extender situation. The best thing you can do, though it involves a bit more work, is to get your files into a format that will play within Media Center natively as well as on extenders. In steps WTV.
Starting with the (technically) OEM only TV Pack in Windows Vista, Microsoft decided to replace the DVR-MS container format with WTV. WTV allows the use of AVC/h.264 which is typically what you’ll find inside of many MKVs. This makes switching to WTV a quick and easy with the right tools. Luckily, Andy VanTil has provided them for us.
Let me just say a few things here first. Number one, I’m doing all of my conversions on a spare PC. It’s an underpowered laptop but because we’re just doing a container swap, you don’t need a ton of overhead. Depending on your setup, you’re going to be installing filters and these can seriously hose your HTPC if you’re not careful. I’d recommend this method to anyone who has the chance. Your other option is to setup a Windows 7 virtual machine on your HTPC so the two systems don’t touch each other.
Secondly, this method will not get you subtitles. If you’re watching movies that have non-English parts or if you want foreign language subtitles, you’re best bet is to use DVR-MS Toolbox and the “Convert MKV or AVI to DVR-MS” profile. With a properly named subtitle file in the same folder as your video file, you’ll get hard encoded subs in your output.
To get the files that your MKV contains into the WTV container, the first thing you’re going to need to do is use Haali Media Splitter. Andy Van Til has laid out the best method for installing this without totally screwing up your system. (Just scroll down past the Anti-pack installation instructions) This is the procedure I used, including the installation of MediaInfo and Graphstudio. These tools will allow you to see exactly what your MKV files contain as well as which filters your PC is using to render them. Great tools to have.
There are two other tools you’ll need to get this going on. The first is DVRMS Toolbox (DTB). I don’t actually use DTB for the container swaps. That’s handled by Andy’s Todvrms software. Having DTB installed does provide you with two things however. First, the audio in your MKVs needs to be AC3. DTS simply isn’t supported by Media Center extenders so trying to shove it into a WTV container is pointless. If your MKV files contain DTS, you can use a profile created by Ben Drawbaugh to flip the audio to AC3 before using todvrms for the container swap. (Ben’s provided full instructions at the above link to help with this.)
The main application we’ll be using is todvrms version 184.108.40.206. (todvrms version 220.127.116.11 is now available and should supersede version 18.104.22.168) While it’s possible to do this whole process using DTB, it simply has never worked for me. Whether it’s my hardware or what, I have no idea but every time I’ve tried, I’ve gotten unusable output files.
This long write-up comes down to a pretty simple process once you have everything installed. Simply open todvrmsgui.exe Double click the space next to ‘in file’, add the MKV you want to convert. Then simply double click the space next to ‘out dvr-ms’ and name your output. Be sure and check ‘verbose’ and ‘wtv’. Click ‘Go’ and let her run! At this point you’ll see a command window pop open and two files will appear in your output folder: filename.sbe and filename.wtv. There’s no completion percentage in the command window so you won’t really know your progress but todvrms has finished when the command window closes and the .sbe file disappears.
That’s all there is to it. Since you’re only doing a container swap and not actually converting any video, the process usually takes less than five minutes and there’s zero loss in quality. Provided you start with AVC/h.264 video with AC3 audio, that’s exactly what you’ll get out but in a container format completely compatible with Media Center and Media Center extenders. It’s a lot of work to go through but the end result is well worth it. Full resolution, extender compatible files are what we all want as as long as certain file types aren’t supported, this is the process we’ll have to go through.
If you have another method for converting video files to DVR-MS or WTV files, be sure to share in the comments! Next up? Getting hard-coded subtitles into a WTV!
Thanks to Andy Van Til for his help with this write-up. I hope you find it helpful!