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.

24 Responses

  1. Adam — have you tried using ffmpegX or VisualHub.. or MPEG StreamClip?

    I just tested VisualHub, and it seems like the one you want to use. It has drop-down settings for Apple TV and Apple TV 5.1. On my Mac Pro Quad, 37 minutes for an hour-long program.

  2. I cannot even begin to tell you how helpful – not to mention easy – the QuickTime convert was. All I needed was Perian. I have tried the ffmpegX, and it is messy and hard to understand sometimes. I work on a Mac, and this helps out my projects soooooooooooooooooo much. Thank you for sharing your process.

  3. yea thnx for the tip, i helpt alot :D

  4. I can open MKV fils with QT Pro and Perian but cannot export them to another format, Sad. VisualHub can make the conversion.

  5. I retreact my previous comment….with large files it takes time for QT to open them fully, so be patient ;-0

  6. yeah but what about 5.1 sound, seems like it converts it to 2 channel?

  7. I used Visual Hub to try to convert a saved .mov file that was originally opened in QT Pro as a .mkv file. QT Pro stalls trying to export the .mkv file and trying to convert to mp4 in Visual Hub leads the minutes remaining indicator to go ridiculously high and never finish. This file also has a subtitles track so maybe that’s the issue but if anyone could enlighten me, great.

  8. Use VLC, choose “File”, then “Streaming/Exporting Wizard”

    If you do not choose to transcode the video, you can just select another container instead of .mkv.

    But most likely you need to transcode the audio.

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

    The blog is now a ’sponsored link’ farm. The domain is owned by squatters now.

    This youtube video (http://www.youtube.com/watch?v=bnhVcJElPoI) has excellent directions. (Not a Rick Roll either)

  10. Just for fun I tried to convert some .mkv files in iSquint. It seems to work very well without any extra effort. The only thing I have noticed is that the frame-rate of the converted file seems lower (video is choppy)
    Still, in a pinch, iSquint did the job, best of all, the program is free =)

  11. YES. a simple easy solution none of this termnal stuff and no reconverting either.
    all along i have been using vlc player and never new it was able to remux and change the container format . so here we have a possible solution to the lack of mkvtovob program for windows
    i have only just found this out and havent tested it yet but the guy that wrote this says it works fine . this is based around getting the file to work on a ps3
    (taken from a forum)

    1. Get VLC.
    2. Open up the streaming and transcoding wizard (its under the file menu).
    3. Click transode/save to file press next.
    4. Then select your stream, press next.
    5. On the Transcode page make sure none of the options are on, turn them off if they are. You don’t want to transcode your just remuxing. Press next.
    6. Chose MPEG PS, press next.
    7. Chose your save destination, press next.
    8. Check if the details a correct and press finish, then wait while it does it business.

    This works on PC and Macs, all you have to do is then transfer it to your PS3.

  12. Awesome, danials solution works perfect, unfortuntately the resulting files are quicktime compatible, but work fine in VLC and to my PS3 (via ushare uPnP server).
    Thanks!

  13. The text (not images though) of the original blog mentioned on this page with instructions on how to user Perian was still available on the Wayback pages at this URL: http://web.archive.org/web/20071231013046/http://blog.kifr.net/2007/12/convert-mkv-to-mp4-with-your-mac.html . Maybe Adam can strip out the text and include it as an update on his blog since the original page is no longer hosted. Also, I found another independent tool called MKVtools 2.1 that will convert from a .mkv file to an .mp4 file with pass-through, meaning that the video and audio don’t need to be resampled.

  14. iSquint did the job, best of all, the program is free
    http://www.wikihow.com/Use-Open-Source-to-Build-iSquint-and-VisualHub

  15. I did the quicktime thing, and it opened and played in quicktime…but i had no sound. can i fix this at all??

  16. I tried the Handbrake option and it did not work. Handbrake kept quitting “unexpectedly”. It recognized the file type but could not rip it to m4v.

  17. Handbrake 0.9.3 is bugged like hell on Core Duo 2 Apple computers. Don’t expect anything from Handbrake untill a new and better version is released.

  18. Thanks for your help. Handbrake is a little buggy but it works and has been great.

  19. Sigh…Here are my findings with an MKV that contains multiple audio tracks, subtitles, and video in h264…

    iSquint / VirtualHub only support 1 audio track and no chapters… thus these apps have only rudimentary support of the file formats they claim to support. Hardly a 1st or even 2nd class solution.

    VLC transcoding resulted in corrupt file (as .mpg or .mp4).

    Handbrake, didn’t detect the chapters correctly; shows only 1 chapter, despite the file having discrete chapters. Worse, doesn’t do pass through (http://forum.handbrake.fr/viewtopic.php?f=5&t=9179)

    Quicktime + Perian; won’t open the file, says unrecognized for some reason (i don’t have other mkv files to test).

    Trying with the as of yet unmentioned RoadMovie, crashed RoadMovie.

    Also looked at a few other paid apps, but all had the same shortcomings of VirtualHub (rudimentary file format support).

    Am amazed good tools for creating full mp4 files, with subs and multiple tracks, doesn’t exist. Also am amazed me that someone would write a tool, but then not completely support the file format they claim to be a solution for. From what I’ve seen, most couldn’t “bother” to use existing Mac UI instead of rolling their own (worse) version, such I can’t be bothered to buy their app.

  20. This article is helpful. Also, here is a good tutorial about how to play mkv files and convert mkv to mp4 avi and so on:
    http://hd-video-converter.blogspot.com/2009/05/convert-mkv-to-mp4-avi-to-play-on-ps3.html

  21. THANK YOU!!!! This info has saved me hours of work! Thank you very much.

  22. [...] gesucht, diese möglichst kostenlos ins MP4 (h.264) Format zu konvertieren. Am Ende es war doch garnicht so schwer: HandBrake unterstützt MKV Dateien als Quelle. Folglich kann mein Tutorial Videobearbeitung am Mac [...]

Leave a Reply