Adding AC3 Dolby Digital 5.1 multichannel audio to an MP4 without re-encoding

I recently “obtained” some video files which had 5.1 surround sound encoded as AAC, but AppleTV does not play multichannel audio in AAC format.

While AppleTV can play back stereo or Dolby Pro Logic II in AAC format, it requires multichannel audio be encoded as AC3. None of these “acquired” MP4s have AC3 5.1 6-channel audio!

I could encode the file again, but that takes to much time. Is there a way I can just add or import AC3 multichannel audio to my existing video files?

The short answer is yes.

You need Handbrake to re-encode the audio, and QuickTime 7 to handle the remuxing. QuickTime X (like Apple’s other “improvements” is actually a drastic step backward. Luckily, QuickTime 7 can run on OSX 10.8 Mountain Lion and earlier.

First, create a preset with very poor video quality in order to affect a fast encode (5 FPS, 1kbs data rate, no filtering, small output size, etc.). It’s very important to your encoding speed that you turn off all filters such as decomb in Picture Settings. Set the audio to your desired settings. Note, you should keep anamorphic to loose in order to handle video with varying dimensions… otherwise, Handbrake will crash! On a Late 2011 2.5 GHz i5, I get about 280 FPS.

I’ve set up some screen shots below:

1-video 2-Audio

 

Once your file encodes, load it and the original MP4 into QuickTime 7.

With the newly encoded file (with the audio you want to keep) selected, issue Command-J. Highlight the two audio tracks (Stereo and Surround) and copy (Command-C).

Screen Shot 2013-06-30 at 11.11.11 AM

Select the MP4 file into which you want to copy the new multichannel audio.  Select all (Command-A) and ensure the scrubber is at the zero mark. Choose “Edit -> Add to Movie” or Option-Command-V. Do NOT use regular copy, as it will append or prepend the clips, instead of adding the new audio on new tracks.

Screen Shot 2013-06-30 at 11.12.15 AM

 

Now, if you issue Command-J on the MP4 file, you’ll see that you have two video tracks, and many audio tracks. Check to make sure that the new audio tracks start at 0:00:00.00. Highlight the tracks you don’t want and delete them.

Screen Shot 2013-06-30 at 11.15.02 AM

 

Save the file, which will save as a .MOV file (which plays fine on AppleTV)!

Instead of taking 2-2.5 hours to re-encode, this operation takes a total of 7 minutes.

Leave a Reply