HOWTO (two videos): Preserving the AC3 audio track in a MOV (MP4 / M4V) file

In the MacRumors iPad forums, I've run into the question (see THIS) whether it's possible to (re-)add an AC3 track to an M4V file. (As you may already know, it's essential that you convert your videos, particularly high-resolution ones, to M4V / MOV / MP4 files so that the hardware decoder can play them back. There is no other way of playing other high-res formats back – other than jailbreaking, of course, and using the almighty XBMC.) I answer the question, with no less than two tutorials (along with their respective video), in a dedicated article. In addition, at the end of the article, I explain how you can quickly extract parts of a large(r) MKV file.

The source MKV video file with a single AC3 audio track I use in the tutorial videos is HERE.

With iVI (Pro)

I don't really recommend using iVI (Pro) for MKV > M4V remuxing (see my review HERE), but if you still prefer it and want in your both an AAC and an AC3. This is the easiest solution – but, again, with huge MKV files, can be at least ten(!) times more time-consuming than using Subler and manually adding the AC3 tracks.

The video below shows how easy it is to do all this. I drag the input MKV file onto iVI, start conversion and, finally, check with VLC the just-created MP4 file indeed has two audio tracks (the AAC track created by iVI + the original AC3 track).

The iVI (Pro)-less way

1, extract the AC3 track with iMkvExtract (ONLY the audio file!)
2, open the M4V file to add the AC3 track to in Subler. Click the + button and select the AC3 file. Make sure you uncheck "Convert AC-3 audio to AAC" box in Preferences > Audio before this!
3, Save the video with Cmd + S: it will be very quickly saved.

There's a demo video showing all these, along with remuxing the entire MKV file to M4V first (an additional step; in the above list, I've assumed we already have a target MP4):

Master your iPhone in one minute a day:

Sign up to iPhone Life's Tip of the Day Newsletter and we'll send you a tip each day to save time and get the most out of your iPhone or iPad.

At the beginning, I start right with iMkvExtract (please see my dedicated article HERE on making it work with the latest MKV files). Click “Browse” to browse to the MKV file to demux the AC3 audio track from; select it; click Choisir (0:06). Untick all the other tracks (you can use Uncheck all); in the video, I only needed to untick the video stream. Click “Extract” (0:09) and, after finishing the export, OK.

Now, we can go on working in Subler. In the following section in the video, I show you how it can be used to remux the original MKV file to a AC3-track M4V file. (It's at 1:18 that I show you the original MP4 had an AC3 track in it (the previous VLC invocation still had an old video in it; this is why I, when finding this out, quit and, then, restart it). During making the video, I've changed the order of adding the AC3 and AAC tracks. However, this oversight doesn't have any effect on how this all needs to be done. Just make sure you disable "Convert AC-3 audio to AAC" box when adding the AC3 track you indeed want to save without changing!)

It's at 1:25 that adding a new audio track to the already-existing M4V file starts. As explained in the ordered list at the top, I click +, select the AC3 audio file (1:38), click Add and change the state of the "Convert AC-3 audio to AAC" box so that it doesn't convert the just-added stream to AAC. (Again, you won't need to touch this checkbox if you don't use Subler for MKV > M4V demuxing but already have your M4V's you want to add your AC3 tracks to.) Then, I save the file (Cmd + S).

The result AAC + AC3 M4V file shown in the video HERE. I've set its H.264 level back to 4.1 (so that it can be synched to the stock iOS Videos app via iTunes) and also meaningfully named the two sound tracks (ac3 vs. aac) so that they have different names also hinting on the format they're in. Both the desktop iTunes and the iOS Videos app (and also the hardware plug-in) will only play back the AAC track; third-party players (for example, VLC on the desktop or GoodPlayer on iOS) will play back both (GoodPlayer in software-only decoding mode only, of course).

Trimming / extracting parts of MKV files

You may want to know how I've created the test MKV video used for the tutorial: with the free, (Windows only) AVI Trimmer + MKV 2. You may want to check  out THIS for a video showing it in action. It's only capable of exporting one audio track and no subtitles. Unfortunately, the (non-free) version 3 can't export more than one audio track either. (No subtitle support in that either.)

Unfortunately, I couldn't find any similar quick MKV extractor app for Mac OS X. (Nevertheless, the above app works just fine in Parallels.)

Master your iPhone in one minute a day: Sign up here to get our FREE Tip of the Day delivered right to your inbox.

<p>Werner Ruotsalainen is an iOS and Java programming lecturer who is well-versed in programming, hacking, operating systems, and programming languages. Werner tries to generate unique articles on subjects not widely discussed. Some of his articles are highly technical and are intended for other programmers and coders.</p>
<p>Werner also is interested in photography and videography. He is a frequent contributor to not only mobile and computing publications, but also photo and video forums. He loves swimming, skiing, going to the gym, and using his iPads. English is one of several languages he speaks.</p>