AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont play?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont play?

Post by Diranged »

So I've got 2 AppleTV 2's in my house... I have one hooked up to a full entertainment center, with a proper receiver that supports everything. It works great. All of my videos, HD, not HD, etc work perfect. The movies with multiple tracks (Dolby Digital 5.1) work perfect.

However, I got a second unit upstairs hooked directly up to a regular TV via the HDMI cable and it can't play HD movies that happen to have a Dolby 5.1 track. Before the recent AppleTV update, they would start playing and immediately quit. Now after the update they just error out with the ATV saying that it can't play the movie.

I'm fairly certain I'm going to need to re-mux the videos somehow .. but I'm wondering if anyone has a solution for this? Do I need to re-order the audio tracks in some way so that the Dolby Digital track is last, instead of first?
User avatar
Rodeo
HandBrake Team
Posts: 12572
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Rodeo »

Diranged wrote:Do I need to re-order the audio tracks in some way so that the Dolby Digital track is last, instead of first?
The question would be why did you change the track order in the first place? HandBrake presets that include an AC3 track (and more importantly, all HandBrake presets that include an AC3 track and target Apple devices) have an AAC track before the AC3 track. This wasn't decided with a coin toss.
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

argh i did a bit more digging.. it appears that the movies that fail somehow only ended up with an AC3 audio track, and nothing else. im guessing this is why the failure occurs -- if i dont have a device hooked up that can play the AC3 track, atv just fails.

if thats the case... any thoughts on a way to build the AAC audio track from the AC3 original track thats in there? im pretty good at scripting, so if i can figure out a way to do it to one file, i can quickly run through and fix it on the 15 or so videos I found with AC3-only tracks in them..
User avatar
Rodeo
HandBrake Team
Posts: 12572
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Rodeo »

FFmpeg may be able to do it.

Subler (Mac-only) can also convert AC3 to AAC (using Apple's AAC encoder, which is better than either faac or FFmpeg's AAC encoder) without re-encoding the video, but it's a GUI. Perian must be installed (for its AC3 decoder).

Enable "AC-3 audio to AAC" in Subler Preferences, select a 2-channel mixdown (anything up to Dolby Pro Logic II), relaunch (may be required for the option to take effect). File > New then File > Import > File…, point it to the existing MP4 file and import all tracks (and metadata if you like), then save to a new file.

IIRC that will not include the AC3 track in the new file; convert all your AC3-only movies first, then disable AC3 conversion in Subler Preferences, relaunch again. Open the MP4 files with the AAC track in Subler (File > Open…), File > Import > File… from the original MP4s (deselect everything but the AC3 track), then Save.
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

Ok, I feel like I'm close ... but its not quite working. I can get ffmpeg to:

a) 'copy' the video and audio streams as-is into a new file: this produces a playable file, on my appletv hooked up to a reciever. obviously, no help to the appletv that can't pass the ac3 signal anywhere
b) 'copy' the video signal, and generate an 'aac 128k 2-channel' audio track instead: this produces a file that plays fine everywhere, but only has 2-channel audio
c) 'copy' the audio and video signals to track 0.0 and 0.1. then create a third track that is 'aac 128k 2-channel audio': this produces a file that looks fine, but only works on the appletv with no digital audio hooked up. the appletv hooked up to my receiver plays, but plays without any audio at all.

I'm not sure what the heck I'm doing wrong.. any remuxing experts out there? Here's my script to do a single file... you can see many of the different acodec lines I've been trying:
#!/bin/sh

FILE="$1"
FFMPEG="/opt/local/bin/ffmpeg"

if [ "$FILE" == "" ]; then
echo "You must run the command with a filename as an option. Ex: $0 <filename>"
exit 1
fi

$FFMPEG -i "$FILE" -y \
-t 120 \
-f mp4 \
-map_meta_data 0:0,g0 \
-vcodec copy \
-acodec copy \
"new-$FILE" \
-acodec aac -ab 128k -ac 2 -strict experimental -newaudio \


# -acodec libfaac -ab 128k -ac 2 -newaudio \
# -acodec aac -ab 128 -ac 2 -strict experimental -newaudio \
# -acodec copy -newaudio \
# -acodec aac -ab 128k -ac 2 -strict experimental -newaudio
# -acodec aac -ab 448k -ac 6 -strict experimental \
# -acodec ac3 -ab 640k -ac 6 -ac 6 "new-$FILE" \
# -acodec aac -ab 448k -ac 6 -strict experimental -newaudio \
# -acodec aac -ab 128k -ac 2 -strict experimental -newaudio

# -acodec ac3 -ab 640k -ac 6 -ac 6 "new-$FILE" \
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x10100b000] max_analyze_duration reached

Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 90000.00 (180000/2)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Wall Street: Money Never Sleeps (2010).m4v':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2011-03-01 16:04:43
encoder : HandBrake 0.9.5 2011010300
title : Wall Street: Money Never Sleeps
date : 2010
artist : Oliver Stone
genre : Drama
copyright : Edward R. Pressman Film
description : As the global economy teeters on the brink of disaster, a young Wall Street trader partners with disgraced former Wall Street corporate raider Gordon Gekko on a two-tiered mission: To alert the financial community to the coming doom, and to find out who wa
Duration: 02:12:58.43, start: 0.000000, bitrate: 3248 kb/s
Chapter #0.0: start -0.083411, end 507.983956
Metadata:
title : Chapter 1
Chapter #0.1: start 507.983956, end 795.521200
Metadata:
title : Chapter 2
Chapter #0.2: start 795.521200, end 965.107289
Metadata:
title : Chapter 3
Chapter #0.3: start 965.107289, end 1239.297867
Metadata:
title : Chapter 4
Chapter #0.4: start 1239.297867, end 1541.474744
Metadata:
title : Chapter 5
Chapter #0.5: start 1541.474744, end 1785.093122
Metadata:
title : Chapter 6
Chapter #0.6: start 1785.093122, end 2102.410122
Metadata:
title : Chapter 7
Chapter #0.7: start 2102.410122, end 2423.897956
Metadata:
title : Chapter 8
Chapter #0.8: start 2423.897956, end 2699.381500
Metadata:
title : Chapter 9
Chapter #0.9: start 2699.381500, end 2961.601789
Metadata:
title : Chapter 10
Chapter #0.10: start 2961.601789, end 3267.991200
Metadata:
title : Chapter 11
Chapter #0.11: start 3267.991200, end 3636.108956
Metadata:
title : Chapter 12
Chapter #0.12: start 3636.108956, end 3828.259244
Metadata:
title : Chapter 13
Chapter #0.13: start 3828.259244, end 4186.658956
Metadata:
title : Chapter 14
Chapter #0.14: start 4186.658956, end 4588.685578
Metadata:
title : Chapter 15
Chapter #0.15: start 4588.685578, end 4868.173122
Metadata:
title : Chapter 16
Chapter #0.16: start 4868.173122, end 5118.423122
Metadata:
title : Chapter 17
Chapter #0.17: start 5118.423122, end 5256.561122
Metadata:
title : Chapter 18
Chapter #0.18: start 5256.561122, end 5569.498744
Metadata:
title : Chapter 19
Chapter #0.19: start 5569.498744, end 5862.374667
Metadata:
title : Chapter 20
Chapter #0.20: start 5862.374667, end 6087.808200
Metadata:
title : Chapter 21
Chapter #0.21: start 6087.808200, end 6314.951789
Metadata:
title : Chapter 22
Chapter #0.22: start 6314.951789, end 6487.832833
Metadata:
title : Chapter 23
Chapter #0.23: start 6487.832833, end 6824.043700
Metadata:
title : Chapter 24
Chapter #0.24: start 6824.043700, end 7129.181867
Metadata:
title : Chapter 25
Chapter #0.25: start 7129.181867, end 7299.935789
Metadata:
title : Chapter 26
Chapter #0.26: start 7299.935789, end 7591.226789
Metadata:
title : Chapter 27
Chapter #0.27: start 7591.226789, end 7977.696200
Metadata:
title : Chapter 28
Stream #0.0(und): Video: h264, yuv420p, 1280x544 [PAR 1:1 DAR 40:17], 2604 kb/s, 23.98 fps, 90k tbr, 90k tbn, 180k tbc
Metadata:
creation_time : 2011-03-01 16:04:43
Stream #0.1(eng): Audio: ac3, 48000 Hz, 6 channels, s16, 640 kb/s
Metadata:
creation_time : 2011-03-01 16:04:43
Stream #0.2(und): Subtitle: text / 0x74786574
Metadata:
creation_time : 2011-03-01 16:04:43
Output #0, mov, to 'new-Wall Street: Money Never Sleeps (2010).m4v':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2011-03-01 16:04:43
description : As the global economy teeters on the brink of disaster, a young Wall Street trader partners with disgraced former Wall Street corporate raider Gordon Gekko on a two-tiered mission: To alert the financial community to the coming doom, and to find out who wa
title : Wall Street: Money Never Sleeps
date : 2010
artist : Oliver Stone
genre : Drama
copyright : Edward R. Pressman Film
encoder : Lavf52.92.0
Chapter #0.0: start 0.000000, end 90.000000
Metadata:
title : Chapter 1
Stream #0.0(und): Video: libx264, yuv420p, 1280x544 [PAR 1:1 DAR 40:17], q=2-31, 2604 kb/s, 90k tbn, 90k tbc
Metadata:
creation_time : 2011-03-01 16:04:43
Stream #0.1(eng): Audio: ac3, 48000 Hz, 6 channels, 640 kb/s
Metadata:
creation_time : 2011-03-01 16:04:43
Stream #0.2(eng): Audio: aac, 48000 Hz, 6 channels, s16, 448 kb/s
Metadata:
creation_time : 2011-03-01 16:04:43
Stream #0.3(eng): Audio: aac, 48000 Hz, 2 channels, s16, 128 kb/s
Metadata:
creation_time : 2011-03-01 16:04:43
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Stream #0.1 -> #0.2
Stream #0.1 -> #0.3
Press [q] to stop encoding
Input stream #0.1 frame changed from rate:48000 fmt:s16 ch:6 to rate:48000 fmt:s16 ch:2
Last message repeated 1 times 41898kB time=86.52 bitrate=3967.0kbits/s
frame= 2156 fps=243 q=-1.0 Lsize= 45385kB time=89.82 bitrate=4139.5kbits/s
video:34808kB audio:10456kB global headers:0kB muxing overhead 0.268860%
User avatar
Rodeo
HandBrake Team
Posts: 12572
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Rodeo »

So your output files end up with the video (#0.0), then the AC3 audio (#0.1), then the AAC audio (#0.2)?
Can you use ffmpeg to reverse the order of audio tracks (AAC first, AC3 second) and check if it works?
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

Tried that as well, the file is created fine -- but theres no difference in the audio playback issues. Still works on the appletv without a receiver hooked up, and doesnt work on my appletv with a digital receiver.
User avatar
Ritsuka
HandBrake Team
Posts: 1163
Joined: Fri Jan 12, 2007 11:29 am

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Ritsuka »

Can you try this version of Subler? http://www.mediafire.com/?nqc3rgc11477q2v
There is a new "fallback" property on the audio track. You should try selecting the ac-3 track, and setting the fallback to the number Id of the aac track.

Apple's movies have that property, maybe the ATV 2 can make good use of that.
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

http://s2.postimage.org/7i175v3fp/Scree ... _26_AM.png

so this is with the new subler.. interestingly, it behaves exactly as i had with ffmpeg.. plays fine on the non-digital appletv, but on the digitally hooked up appletv, it plays with no audio. argh..
User avatar
Ritsuka
HandBrake Team
Posts: 1163
Joined: Fri Jan 12, 2007 11:29 am

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Ritsuka »

You should disable the ac-3 track too. And set the Alternate Group of the two audio tracks to "1".
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

will test that shortly.. can you tell me what those two do?
Diranged
Posts: 26
Joined: Fri Mar 23, 2007 7:41 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by Diranged »

well sh..t... that worked! so what exactly is that change doing?
FaiT
Posts: 47
Joined: Wed Mar 23, 2011 9:54 pm

Re: AppleTV 2 + Dolby Digital + HDMI - Dolby Support= wont p

Post by FaiT »

You know I was reading this thread and was about to suggest that but someone beat me to it. Had a very similar problem. I'm not a tech guy but in my experience apple stuff attempts to play all audio unless you have specifically disabled all streams except the default one and set the alternate group for them. The fact that your Apple TV simply didn't play anything seems strange but now that I think about it... My theory is that it tried to play them simultaneously but since they are different formats it caused an error which prevented audio entirely. I have no technical knowledge of anything involved so take that how you will.
Post Reply