How to Convert MKV to MP4 on Mac OS X

A lot of video online is being distributed in MKV format (aka “Matroska Video”).  Not knowing anything about this format, I did a search for ways to convert this to MP4 for the AppleTV/MacMini/iTunes family, but found mostly Windows-based or command-line utilities.

Then this forum discussion popped up, and pointed me to a very cool solution that I had to share.

Basically, you can do it with Quicktime Pro, but only if you download this free extension to Quicktime that adds support for a large number of video formats.

The magic free extension, which is distributed as a System Preference panel file, is called Perian, the Swiss Army Knife for Quicktime. Quick download, mount disk image, double-click on preference panel file, and you are ready to convert.

Once you have Perian, you just open the MKV file with Quicktime, and export it to either MP4 (with specific settings), or use the AppleTV or iPod export settings.  That’s it, really.

This blog had a wonderful, detailed step-by-step process, with screenshots.  I found it invaluable.

Hope this helps.  The only downside to this is that it really is only practical for MKV files out there that already use H.264 for encoding, and that have settings compatible with iTunes.  So far, I’m finding that most do, but your mileage may vary. Also, it takes Quicktime Pro about 30 minutes to convert a 2 minute movie on my PowerMac G5, Dual-2.5Ghz.  So this isn’t really practical with full length pictures unless you are willing to leave it running for hours.

Let me know if you have a better solution.

Update (10/5/2008): The blog that had the instructions is now gone.  There is a new solution posted on tehparadox.com.

Update (12/13/2008): Thanks to the comment below for a pointer to MKVTools 2.1.  Looks like a new alternative for MKV to MP4 without re-encoding.

Update (01/04/2009): Stop everything.  There is a much better solution now.  Handbrake 0.93 lets you specify an MKV file as a source, and then lets you convert to a variety of outputs.  I’m not sure if it introduces any unnecessary compression, but given Handbrake’s reputation, I’d be surprised if they re-encoded when not necessary.  Check it out and post here if you have issues.

Update (11/27/2009): Handbrake 0.9.4 is now out, and it handles MKV to MP4 translation flawlessly.  I highly recommend it.  No other solution comes close for ease of use or quality.  And it’s free.