This is Part III of my article series of my MKV remuxing series (last part HERE), with two main subects: Perian (and the Perian-dependent Subler) on Mountain Lion and selecting the right version of one of the most recommended MKV remuxers, MP4Tools. Let's start with the former.
1. This is how you can still use Perian on Mountain Lion – and remux all your MKV's with Subler
I've very thoroughly examined Perian's more or less broken compatibility (of which I've talked quite a bit in the previous part) with the latest-and-greatest Mac OS X operating system version Mountain Lion (ML for short). One of the reasons for this was simple: during benchmarking and testing, I've found Subler still the best (fastest, most reliable, non-crashing) free remuxer, particularly if you need to keep subtitles. (A lot of other, free or very cheap remuxers – for example, the non-beta version of MP4Tools and Smart Converter - discard or mess up subtitle tracks.)
As has been pointed out in the previous part of this series, without installing Perian, Subler won't be able to convert either AC3 or DTS original soundtracks into AAC ones required by iOS devices. The Apple TV can also play AC3 audio tracks so, should you not want to play back your videos on iPhones or iPads, you don't need to convert AC3 tracks to AAC ones at all. That is, if your MKV input files only have (an) AC3 track(s) and you only target Apple TV's, you can safely skip this article. However, for both DTS tracks and iPhone / iPad / iPod touch users, this article will be of extreme importance.
Fortunately, while Perian is indeed not fully compatible with Mountain Lion by default, with some manual “hacking”, it's very easy to make it work with Subler for both AC3 and DTS conversion. Here's how.
1.1 First, you'll need to download two files:
THIS file is the AC3 encoder and (after decompressing) must be placed under ~/Library/Audio/Plug-Ins/Components in your home directory. I'll later explain when this needs to be done – the order of file copying / overwriting is very important! (Discussion links also linking to the file: thread on Subler's page; another one; and a Russian one with a decent Subler tutorial.)
THIS is the DTS decoder (current, 1.2.3 version; if it becomes unavailable some time in the future, you'll find the working link at Perian's main page). Just install it by clicking “Perian.prefPane” in it, which installs a new preference pane in the Other group of system-level System Preferences:
In the screenshot above, I've annotated the button you'll need to click, should you want to quickly disable Perian. Enabling it will be done via clicking it again when it shows “Install Perian”.
1.2 After installing and enabling Perian...
…you'll already be able to convert DTS (but not AC3!) audio tracks. Give a try to converting THIS file (it has both a DTS and an AC3 audio track) with Subler, making sure you don't untick anything in the “Select Tracks” dialog box. It's the first checkbox list, immediately displayed after selecting the file to load. I've annotated the checkbox showing, by default, Subler imports all tracks, including both AC3 and DTS, from the MKV file you open:
You can quickly learn the audio format a given track is using by casting a glance at the sixth, “Info” column. In this case, it's “DTS” in the annotated row.
The next, “Action” column tells Subler what to do with the given track. With DTS audio tracks, it'll always be “AAC – Dolby Pro Logic II” as DTS must be converted as it can't be natively included in target MP4 / MOV / M4V files, unlike AC3 tracks. In this column, you can also change the output format; generally, only change this if, for some reason, you need to use some other output downmixing. (You'll rarely need to – I don't know of any MP4 player hardware not being able to play back the default, most advanced, MOV container-compliant Dolby Pro Logic II audio.)
Now, let's take a look at the next row, the one with “AC3” type and “2” ID. In the “Action” column, we see the same “AAC – Dolby Pro Logic II”, meaning the AC3 audio track will also be converted into a Dolby Pro Logic II AAC track. Note that, unlike the one with the DTS audio tracks, the default value you'll see here depends on the state of a checkbox and a drop-down list in Preferences. You'll see the same if you enable the "Convert AC3 Audio to AAC" checkbox in Preferences > Audio, annotated by a rectangle in the following screenshot:
Note that if you don't check in this checkbox, you'll see “Passthru” upon the next file opening. Before learning how to enable the AC3 → AAC conversion under Mountain Lion, make sure you see this in this dialog by either making sure the "Convert AC3 Audio to AAC" checkbox is disabled or you manually click “AAC – Dolby Pro Logic II” in the “Action” column and set it to “Passthru”. Then, no failing AC3 -> AAC conversion attempts (which, again, makes it necessary to manually overwrite a file in the file system, which will be later explained) will take place – the input AC3 track will be simply written to the output. (Alternatively, you can just disable the entire AC3 track by unticking the checkbox in the first row.)
Also note that, should you enable the "Convert AC3 Audio to AAC" checkbox, the item you select “Downmix audio to:” drop-down list directly under it will be listed in the Action column:
The screenshot above shows opening files with AC3 tracks with the downmixing default set to “Stereo” (and with the AAC conversion enabled, of course):
Again, you can always override the default setting by directly clicking the entry in the Info column – no need to change the setting in Preferences.
1.2.1 All in all,
if you install Perian only (and make sure you enable it in System Preferences), you'll be able to convert DTS tracks to AAC and also convert MKV files with AC3 audio track(s), assuming you only “passthru” them (or disable them entirely).
1.3 Now, for the AC3 -> AAC conversion part...
As I've already hinted on, should you want to convert your AC3 track(s) to AAC('s) instead of just “pass-thruing” them into the target MP4 file, AC3 support must be separately enabled under Mountain Lion – as opposed to earlier OS X versions.
To do this, copy the (decompressed) AC3 encoder file I've linked to in Section 1.1, A52Codec.component to ~/Library/Audio/Plug-Ins/Components. There won't be anything in that directory if you haven't installed Perian before. The directory should look like as follows after you've done copying:
Note that, in the screenshot, I've also right-clicked the directory name to show you the entire path – it's under my home directory (/Users/werner in this case).
Also note the date of the file I've annotated. The ML-compatible A52Codec.component will have a timestamp of Jul 27, 2012.
If you have installed Perian, it'll put its own version of A52Codec.component with the timestamp Jul 23, 2011 (it's based on these timestamps that you can easily know which version is currently installed):
You can safely overwrite this file.
Note that, when you, in System Preferences, disable Perian (if it's installed), A52Codec.component will be immediately removed, regardless of its source (Perian or the updated, ML-compliant, new file). In addition, when you (re-)enable Perian, it'll overwrite the updated A52Codec.component file. Therefore, it's always best to make sure you do copy back the newer (2012), ML-friendly file to the directory after re-enabling Perian. This can easily be done manually – or with a script if you write one.
2. MP4Tools tips and tricks
In the last part of this series, I've recommended MP4Tools as one of the best MKV remuxers. However, there's a clear difference between the two versions you should be aware of.
There's a stable version (last updated this Spring) and a beta (last updated, as of beta13, early Septermber). The latter is much more powerful, faster and reliable than the stable version but has its own shortcomings. The latter mostly mean (still) missing track editing capabilities, which, when “only” remuxing MKV's to MP4's, won't be an issue. The developer has listed the still-not-reimplemented functionality on its beta download page. It's this very page that you should download the beta from.
The two versions can safely co-exist. The serial number originally purchased for the old version will work with the beta too.
Note that there are also MKV videos incompatible with the new and, otherwise, far more recommended version. An example of them is HERE (warning: 390M download!), the direct Blue-Ray rip of the official Iron Sky (IMDb link) trailer I've made from the Finland-only, official Blue-Ray disc of the (BTW, great – after all, it's Finnish ;-) ) flick. It just can't be converted by the beta version properly – it creates a useless, 4 kByte-file in 1-2 second, totally independent of audio selection. BTW, speaking of this Blue-Ray disc, the “behind-the-scenes” MKV rip isn't converted by the beta either. The main title (17 Gbytes) is.
All in all, whenever possible, use the beta version – it's so much superior. However, when you do encounter problems, switch back to the old one. Or use Subler, which, now that the DTS / AC3 audio conversion problems are fixed under ML, should be preferred in most cases to the old version of MP4Tools: much faster, much more reliable: no crashes, as opposed to the constant crashing of the old version of MP4Tools etc. And yes, it doesn't mess up the (textual) subtitles either - the old version of MP4Tools does if there're more than one track in the source MKV file.
I've also talked about the differences between the two versions HERE (full thread).