Handbrake Transcoding

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Shibblet
Novice
Posts: 69
Joined: Sun Sep 06, 2009 12:17 am

Handbrake Transcoding

Post by Shibblet »

Is there any way to make Handbrake just encode the audio?

I am currently in the process of converting my DVD collection into MKV's. I am using x264 (h.264) for the video, and keeping the AC3 audio track. But I recently got a device that will only run MP4's. So, I need to go back and convert the MKV files to MP4 with AAC audio.

My reasoning, is that the video is already h.264, but the audio needs to be encoded from AC3. Can I just encode the audio and leave the video stream alone for quicker encoding?

I tried a program called Avidemux, but it gives me bad results. Audio-sync problems and the like.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Handbrake Transcoding

Post by s55 »

It isn't supported.
hunterk
Bright Spark User
Posts: 179
Joined: Tue Jun 03, 2008 2:27 pm

Re: Handbrake Transcoding

Post by hunterk »

Handbrake doesn't do it, but ffmpeg should be able to handle it just fine using -acodec copy and -vcodec copy
Shibblet
Novice
Posts: 69
Joined: Sun Sep 06, 2009 12:17 am

Re: Handbrake Transcoding

Post by Shibblet »

hunterk wrote:Handbrake doesn't do it, but ffmpeg should be able to handle it just fine using -acodec copy and -vcodec copy
It does it, but the output is weird. I've also tried a program called AviDemux, and it reproduces the same thing. The h.264 video becomes choppy, or has odd frame rates when the audio is converted from DD5.1 to 2-Ch Stereo AAC.

What I'm trying to accomplish is keeping my encodes in two different formats. One MKV with AC3 (or DTS) for my Home Theater, and another MP4 with AAC Stereo for use on other PC's, or devices like tablets, around the house.
rachel
Novice
Posts: 71
Joined: Thu Mar 15, 2007 7:34 pm

Re: Handbrake Transcoding

Post by rachel »

You probably won't like the answer but it's the only thing that worked for me in the end, when I had a very similar requirement.

I used SmartConverter, which just passes through a track if it doesn't need to transcode it for the target device. The reason you might not like it is that it's a Mac app, and this is the *nix forum. :-} But it is the only thing that worked; having wasted hours and hours trying to get things like mencoder, ffmpeg, vlc, mp4box et al to do the work.

In my case I wanted to convert some files that were originally encoded for AppleTV (ie: h.264 video, aac audio) but which I'd foolishly run through mkvmerge at some point in the past and turned into mkvs, so that I could make them play on AppleTV again. (No I can't remember why I turned them into MKVs; it was around the time I was switching from appletv to xbmc and didn't anticipate that i'd want to use an appletv again.)

But I think it does it on a track-by-track basis, so if you pick the appropriate destination and the video track is in-spec for it, but the audio track needs transcoding, I think it'll do it. Even if not, you could take your original, pass through handbrake to encode the audio (wastefully encoding the video too), then mkvmerge the video from the original and the audio from the file just created, then smartconverter to turn it all into mp4. Hideous but I think that'll work.

(But SmartConverter works by converting to known playback devices eg: appletv, android phone, etc.; if your device isn't on the list it'll probably start getting recalcitrant; it's not anything like as tweakable as handbrake. Not at all, in fact.)
Shibblet
Novice
Posts: 69
Joined: Sun Sep 06, 2009 12:17 am

Re: Handbrake Transcoding

Post by Shibblet »

Well, I think I have solved my problem. And I hope someone can explain this situation to me, because I am not sure that I understand this.

When I do my encodes to MKV, I had B-Frames enabled. When AviDemux would load the MKV, it told me that B-Frames could lead to frame de-sync... Okay, I get that. So I reencoded a quick video that I test with, and set the B-Frame value to 0. Then ran the test video through AviDemux. Came out perfect as an MP4 with Stereo sound from an MKV with AC3 Audio.

Then I tested a full 2 hour film. And it worked perfectly as well.

So, my problem is solved. Don't use B-Frames on my encodes. However, I don't understand why. If AviDemux is just copying the video stream, why would anything be desynced? It even desyncs MKV with AC3 to MKV with AC3. What's the dealio-yo?

**EDIT**
I tested again with "Pyramidal" B-Frames set to "OFF". This makes it so the B-Frames aren't used as reference. This seems to work better. I get a better encoding efficiency (and I do understand why B-Frames make for better encoding), and the ability to quickly transcode.

I still don't understand why this would cause a problem before.
Post Reply