Category Archives: Uncategorized

Using Handbrake to Convert Audio

Handbrake is the best conversion utility around. It’s just good at what it does. Yes, it has many advanced features, but if you want to convert video really just pick a preset and you’re on your way.

It’s also superb at converting audio. It can take DTS or AC-3 and turn it into AC-3, MP3, AAC, or OGG. And it can do that while letting you choose a downmix, meaning you can take a nice sounding AC-3 or DTS and output 3 tracks if you wish: AC-3 at 5.1, AAC at 5.1, and a stereo (2-channel) AAC with, say, a Dolby Pro Logic II mix down. You’ll have near-perfect compatibility, depending on your needs.

The problem with handbrake is that they refuse to add video passthrough, despite it being a number 1 requested feature. All the developers do is yell at you when you ask about it. They have AC-3 and DTS passthrough, but no kind of video copying. I’ve used Mencoder and FFMPEG for audio conversion and passthroughs, but I never get an output file I’m happy with. Either the generated MP4/M4V is incompatible with something or the audio quality sucks.

Solution with an MKV (you can adapt this for another input file with, say, MP4Box with an mp4 or similar and can also try Mencoder or FFMPEG to extract)

1. Extract the audio with, say,
mkvextract tracks yourVideoFile.mkv 1:video.h264 2:audio.ac3

2. Mux the extracted audio into a video file (MP4 or MKV preferably) along with a dummy video file:
MP4Box -brand mp42 -add empty.h264 -add audio.ac3 tempOutput.mp4 

3. Convert with Handbrake:
HandBrakeCLI -i tempOutput.mp4 -E aac -6 dpl2 -o tempOutput2.mp4
(This converts an AC-3 to a Pro Logic II stereo AAC within an MP4) 

4. Output is a video file with the audio you want and a dummy video file. You can use the attached ‘empty’ video files (separate AAC and h.264 streams and a muxed .mov container).

Hopefully this helps someone out there. I purposely made the steps vague, you should apply the general method to your situation.


Steve Jobs

Steve Jobs, you didn’t just create Apple.
You didn’t just shape the tech world.
You changed the whole world.
You enabled inspiring things to happen and you enriched the lives of people everywhere.
You leave me with one less idol, but plenty to strive for.
Thanks for the years of service to humanity.
You will be missed, and forever remembered.