PDA

View Full Version : using handbrake to get best audio encoding possible




saltyzoo
Feb 6, 2008, 01:48 PM
This isn't really an Apple TV question, but it seems the experts on this subject matter hang out in this forum and I wasn't sure where else to put it.

I want to encode movies with the best possible 5.1 audio for playback on a mac mini, and possibly Apple TV in the future (after take 2), but for now I'm interested in the mini.

What do I need to know to be sure I get the best possible results as far as audio is concerned using handbrake?

Also, are there limitations in audio playback using quicktime / iTunes / or front row on the mini?

If you couldn't tell I'm still kinda confused about all this.



sJv
Feb 6, 2008, 02:11 PM
This is a confusing topic and I am far from an expert, but tying to come up to speed. I see 3 choices before you:

1) encode to Dolby Pro Logic II - analog matrix encodes 5 channels into the two stereo channels. Just about every surround sound receiver can decode this, but you don't get the most optimal surround sound. Handbrake gives this option. Basically, it's stereo weather you connect via RCA jacks or TOSLink.

2) encode to AAC 5.1. Handbrake gives you this option. I do not know if Quicktime will extract this and pass it unmolested to the TosLink output. Very few receivers can deal with this anyway, so it's not a good option for most people.

3) merge the Dolby Digital 5.1 AC3 stream with the H.264 video stream. I do not know if Quicktime will extract this and pass it on to the TosLink, but if it could, this would work great. Can Handbrake even do this? I do not see this as an option in handbrake.

#3 I see as the holy grail. Take 2 will support some form of this (presumably QT will have an update). Handbrake or VisualHub will need to add this as an option.

Does anyone know if this can be done now in preparation for the updated take 2 firmware, or will we have to wait for the tools to be updated?

-steve

This isn't really an Apple TV question, but it seems the experts on this subject matter hang out in this forum and I wasn't sure where else to put it.

I want to encode movies with the best possible 5.1 audio for playback on a mac mini, and possibly Apple TV in the future (after take 2), but for now I'm interested in the mini.

What do I need to know to be sure I get the best possible results as far as audio is concerned using handbrake?

Also, are there limitations in audio playback using quicktime / iTunes / or front row on the mini?

If you couldn't tell I'm still kinda confused about all this.

NightStorm
Feb 6, 2008, 03:03 PM
The problem with #3 is that the file will be incompatible with other devices (iPod, iPhone) unless Apple decides to somehow allow playback of AC3 streams on these devices. Not important if you aren't looking at creating one file for all the devices, but worth mentioning. If they go this route, they'll likely use a MOV container, and neither program (VH or HB) can currently handle this, and won't until someone decides to write in support from scratch.

The "holy grail" in my opinion would be if the AppleTV could transcode AAC 5.1 into AC3 for output on-the-fly.

Avatar74
Feb 6, 2008, 03:16 PM
The "holy grail" in my opinion would be if the AppleTV could transcode AAC 5.1 into AC3 for output on-the-fly.

It can be done. This would require licensing Dolby Digital Live, more than likely, and therefore increase the cost of the AppleTV. Passthrough doesn't require any payments to Dolby Labs, as far as I know, because the AppleTV 2.0 is merely decoupling the AC-3 from the movie file and passing it on to your receiver's decoder... and has no internal AC-3 decoder to speak of.

However, I'm not sure whether AAC can preserve the metadata from AC-3 such as dialnorm and DRC profiles. I find these metadata very useful, speaking as one who masters Dolby-certified AC-3 content, in ensuring the best home theater experience for viewers across the board regardless of their budget.

Avatar74
Feb 6, 2008, 03:45 PM
#3 I see as the holy grail. Take 2 will support some form of this (presumably QT will have an update). Handbrake or VisualHub will need to add this as an option.

Does anyone know if this can be done now in preparation for the updated take 2 firmware, or will we have to wait for the tools to be updated?

-steve

I do a lot of Dolby Digital mastering and produce content with the blessing of Dolby Labs technical analysts.

My take on this is to wait until Take 2 comes out. The problem being that we do not know yet what the method of AC-3 implementation will be exactly. If there are any significant differences between that method, and the method employed in Handbrake type AC-3 passthrough encoded movies, Handbrake may need to go through a revision before any encodes are successfully decoded by AppleTV 2.0.

NightStorm
Feb 6, 2008, 03:47 PM
It can be done. This would require licensing Dolby Digital Live, more than likely, and therefore increase the cost of the AppleTV. Passthrough doesn't require any payments to Dolby Labs, as far as I know, because the AppleTV 2.0 is merely decoupling the AC-3 from the movie file and passing it on to your receiver's decoder... and has no internal AC-3 decoder to speak of.

However, I'm not sure whether AAC can preserve the metadata from AC-3 such as dialnorm and DRC profiles. I find these metadata very useful, speaking as one who masters Dolby-certified AC-3 content, in ensuring the best home theater experience for viewers across the board regardless of their budget.
Yep, this is exactly how I have always envisioned them adding support for AC3 out. Unfortunately, everything I've seen hints to Apple simply putting HD rentals into a MOV container (which can handle a AC3 audio stream), and it isn't going to be easy/quick to add MOV support into Handbrake.

sJv
Feb 6, 2008, 04:52 PM
While I tend to agree with you, Avatar74 brings up good points. Also, the anemic CPU in :apple:TV may make transcoding on the fly tough. Apple has set their HD/AC3 format apart from the SD format, which I can understand. Does MP4's encoded with AAC 5.1 work on iPod's?

This doesn't mean that you couldn't encode movies for only :apple:TV with AC3, which will not work on the iPod. I would think you'd want to have separate files for iPod's and iPhones anyway to take up less space.

But it sounds like we'll have to see what we are up against when take2 comes out...

-steve

The problem with #3 is that the file will be incompatible with other devices (iPod, iPhone) unless Apple decides to somehow allow playback of AC3 streams on these devices. Not important if you aren't looking at creating one file for all the devices, but worth mentioning. If they go this route, they'll likely use a MOV container, and neither program (VH or HB) can currently handle this, and won't until someone decides to write in support from scratch.

The "holy grail" in my opinion would be if the AppleTV could transcode AAC 5.1 into AC3 for output on-the-fly.

Cave Man
Feb 6, 2008, 05:13 PM
I want to encode movies with the best possible 5.1 audio for playback on a mac mini, and possibly Apple TV in the future (after take 2), but for now I'm interested in the mini.

What do I need to know to be sure I get the best possible results as far as audio is concerned using handbrake?

1. Use Handbrake to encode as and AVI with AC3 passthrough.
2. Open in Quicktime Pro.
3. Save As a Quicktime stand-alone movie.
4. Install Perian and do this (http://geekwithfamily.com/2007/07/05/home-theater/howto-5-easy-steps-to-output-dolby-digital-from-quicktime-player/) modification to your Mini.
5. Drop your movies into iTunes and now you have Dolby Digital passthrough to your receiver via its optical port.
6. Play movies through Quicktime, VLC or Front Row, all with Dolby Digital 5.1 surround.

I now have about 20 movies encoded in this way for my Mini-based home theater. Won't work with the ATV, though.

GabbAHH
Jun 15, 2009, 10:26 PM
Hi, I started a thread here but I haven't gotten too much of a response so I'll give this thread a shot

http://forums.macrumors.com/showthread.php?p=7818232#post7818232

I'm new to a mac and a lot of the whole video/audio encoding/editing world. I realized that a lot of the problems I googled led me to these forums so this would be a good place to sign up and ask away.

So, I'm getting very frustrated converting some of my matroska videos to an mp4 container format (to put into itunes).

For certain videos, the video is fine, but I seem to be missing half my audio, as if it was lagging/skipping for the entire duration.

Under source it says the audio is "Unknown (VORBIS)", which leads me to my first question: What's an easy way to see what type of video and audio you have? I'm assuming my audio is ac3 since the mkv files I have problems with said how I may need an additional codec to play the audio. Strangely, some of the files that give me the message I am able to convert without problems. Currently I have ffmpegX, MPEGstreamclip, and VLC Player, on OS X. VLC Players gives me an even greater slew of problems in converting the mkv-- either I only get audio, or the video is all small blurry as if it was only a couple pixels. I know there are other programs like MP4box, MKVextract, and VisualHub, but I really don't want to add any more programs and make things more complicated if I don't have to.

I've tried changing the sample rates if that means anything and I still have the same problem. Also, why can't I choose AC3 Passthru as the codec? Does that mean that the source audio really isn't AC3?

Thank you mac experts!

NJuul
Jun 16, 2009, 03:21 AM
Hi, I started a thread here but I haven't gotten too much of a response so I'll give this thread a shot

http://forums.macrumors.com/showthread.php?p=7818232#post7818232

I'm new to a mac and a lot of the whole video/audio encoding/editing world. I realized that a lot of the problems I googled led me to these forums so this would be a good place to sign up and ask away.

So, I'm getting very frustrated converting some of my matroska videos to an mp4 container format (to put into itunes).

For certain videos, the video is fine, but I seem to be missing half my audio, as if it was lagging/skipping for the entire duration.

Under source it says the audio is "Unknown (VORBIS)", which leads me to my first question: What's an easy way to see what type of video and audio you have? I'm assuming my audio is ac3 since the mkv files I have problems with said how I may need an additional codec to play the audio. Strangely, some of the files that give me the message I am able to convert without problems. Currently I have ffmpegX, MPEGstreamclip, and VLC Player, on OS X. VLC Players gives me an even greater slew of problems in converting the mkv-- either I only get audio, or the video is all small blurry as if it was only a couple pixels. I know there are other programs like MP4box, MKVextract, and VisualHub, but I really don't want to add any more programs and make things more complicated if I don't have to.

I've tried changing the sample rates if that means anything and I still have the same problem. Also, why can't I choose AC3 Passthru as the codec? Does that mean that the source audio really isn't AC3?

Thank you mac experts!


When you download MKV's, you don't know what you get, so i may be a problem in the original encode.
First, do they play in VLC?
If they do, why convert them if your don't have an ATV?
Second, the audio might be DTS (VORBIS is usually directors comments, I think). Handbrake can convert DTS to stereo AAC, but not pass it through.
If the audio is in AC3, you can simply choose AC3 pass-through.
You can choose which audio stream to pass through/convert in the audio tab. There might be multiple to choose from, if possible, choose AC3 (english).
If there is only the option of down-mixing DTS to AAC stereo, you can use some windows tools to convert into a DD track (google).

If none of this works, I would guess that your file is corrupt somehow.

GabbAHH
Jun 16, 2009, 07:06 PM
When you download MKV's, you don't know what you get, so i may be a problem in the original encode.
First, do they play in VLC?
If they do, why convert them if your don't have an ATV?
Second, the audio might be DTS (VORBIS is usually directors comments, I think). Handbrake can convert DTS to stereo AAC, but not pass it through.
If the audio is in AC3, you can simply choose AC3 pass-through.
You can choose which audio stream to pass through/convert in the audio tab. There might be multiple to choose from, if possible, choose AC3 (english).
If there is only the option of down-mixing DTS to AAC stereo, you can use some windows tools to convert into a DD track (google).

If none of this works, I would guess that your file is corrupt somehow.

Thanks for the reply. Yes, the audio is fine in VLC. I want to convert it so I can have all my movies organized in iTunes. Yes, AAC and stereo are my only encoding options in Handbrake. What is DD?

Right now I'm thinking about using the good audio from the VLC conversion and the good video from the Handbrake conversion, and muxing them together in ffmpegX or something

kadeschs
Jun 17, 2009, 06:50 AM
Thanks for the reply. Yes, the audio is fine in VLC. I want to convert it so I can have all my movies organized in iTunes. Yes, AAC and stereo are my only encoding options in Handbrake. What is DD?

Right now I'm thinking about using the good audio from the VLC conversion and the good video from the Handbrake conversion, and muxing them together in ffmpegX or something

DD = Dolby Digital ? I just wish Apple would open up iTunes to play all common formats. I mean if we're going to be forced to use their software with their hardware, they should at least make things practical for everyday use.

NJuul
Jun 17, 2009, 08:42 AM
Thanks for the reply. Yes, the audio is fine in VLC. I want to convert it so I can have all my movies organized in iTunes. Yes, AAC and stereo are my only encoding options in Handbrake. What is DD?

Right now I'm thinking about using the good audio from the VLC conversion and the good video from the Handbrake conversion, and muxing them together in ffmpegX or something

DD = Dolby Digital (AC3)
My guess is that your file has DTS audio (which is a competing and widely used audio format), and Handbrake cannot convert that to AC3.
There are apps that can, but I think they are all windows though. Personally, I use "AudioConverter", which is freeware, but must be run either on a windows box or through parallels/crossover/WM Fusion/something similar. It takes the DTS stream and converts it into a Dolby Digital stream.
Then you give the MKV to Handbrake, and choose the apple tv preset (and perhaps adjust the picture size to 1280 x whatever). Ensure that the movie is at 24 fps if it is HD material. That's it.

kiranmk2
Jun 17, 2009, 02:00 PM
DD = Dolby Digital ? I just wish Apple would open up iTunes to play all common formats. I mean if we're going to be forced to use their software with their hardware, they should at least make things practical for everyday use.

I think the problem is there is no standard for DTS in an mp4/m4v container. Until there is, nothing will support this.