PDA

View Full Version : 5.1 Sound on Apple TV - Thoughts Scratchpad




JasonKerner
Feb 10, 2008, 03:31 AM
Hi All,

Like many of you, I've been trying to work out how Apple are going to deliver 5.1 into the Apple TV. These are the things we know...

1. Its only for HD rentals.
2. HD rentals won't be made available from iTunes, only Apple TV
3. Its a pass-through solution, so the amp does the decoding rather than the Apple TV (exactly the same as taking optical out of your DVD player).
4. The MP4 container can't support an AC3 track as a soundtrack.

So what about these ideas about Apple is going to pull it off...

As the rentals are only for the Apple TV, and they're releasing a software update, they could mod the MP4 decoder onboard to allow it to play a non-standard, apple-hacked file with a AC3 file in it. The Apple TV has a hardware decoder for the H264 inside due its slow processor, so any change has to be able to cope with that.

It also has to work for people that have HD TVs, but not necessarily a 5.1 system. So something has to be able to convert that file to a normal stereo file. So they could use the Apple TV's sound card to do this - downmix the 5.1 to stereo while its playing. They definitely won't include a stereo mix of the soundtrack on the file as that will eat up more space and leave less for the video track.

Some people have had success adding an AC3 track to a Mp4 file and then saving it as a MOV file, but then we probably lose the ability to add posters, artwork, etc... and even then, normal speakers will just play static as they don't know how to decode the signal. So if we rip films for our machine, how are we to listen to the films when we watch them on computers as a lot of the time we only have stereo speakers and the only program that passes-through AC3 out the optical port is DVD Player.

Heres a thought - what if Apple include a seperate file for the Ac3? The MP4 is bundled with a stereo track (to keep in line with the spec and make it work for non-surround amps), but when the optical port is connected, the software on the Apple TV tells the currently playing track to use the corresponding AC3 file instead. Obviously, the problem here would be, if you're playing the film as you're downloading it - how do you stop the audio running out before the film does? AC3 is compressed at 384Kbps, so it'd be like downloading an high quality Mp3 off the internet, and they are a lot smaller compared to video. So if anything was to run out first, I'd assume it would be the video track, and you'd surely get a message saying its 're-buffering' or something anyway.

Let me know all your thoughts - I know we're all keen to get 5.1 into our own rips. Its all up the air until the update is released, but lets throw some ideas round while we're waiting.

Jason



EvilRob
Feb 10, 2008, 05:06 AM
There's two plausible approaches:


Six channel AAC in an MPEG-4 container
AC3 WAV in Quicktime container

The audio hardware in the AppleTV is capable of transcoding 6ch AAC into AC3 (the "Dolby Live" approach), but this capability is not offered by the current AppleTV software. It's also capable of transcoding 6ch AAC into ProLogic II, which it does today on the 1.x software.

The other possibility is that they avoid the Dolby Live licensing by delivering movies with an AC3 WAV encoded with Apple Lossless, and crammed into a Quicktime container. This works on an AppleTV today, but it's a dirty hack and most people don't want to encode their movies in that weird format.

Personally, I think the first approach is the most likely. Points in favour include Apple's aggressive MPEG-4 compliance and the ability to easily switch between analogue and digital outputs at the AppleTV.

Alternatively, something that suggests the other approach is the current refusal to offer these rentals to desktop iTunes users. While it's possible that this is merely to drive sales of the AppleTV, it's also possible Apple are trying to avoid the support nightmare of delivering AC3 soundtracks to desktop Macs. While the desktop version of Mac OS X can do an optical AC3 passthrough on compatible Macs, it can't do it in a way that's very friendly for normal users (specifically, adjusting the volume below maximum makes some horrible noises). In addition, very few desktop Macs are connected to AC3-capable amplification. It's unlikely Apple would ship that solution to normal users.

I really, really hope it's the first option. ;)

Avatar74
Feb 10, 2008, 05:33 PM
Obviously, the problem here would be, if you're playing the film as you're downloading it - how do you stop the audio running out before the film does? AC3 is compressed at 384Kbps, so it'd be like downloading an high quality Mp3 off the internet, and they are a lot smaller compared to video. So if anything was to run out first, I'd assume it would be the video track, and you'd surely get a message saying its 're-buffering' or something anyway.

Couple of things:

AC-3 is not compressed at 384 Kbps. Dolby Digital 5.1 channel surround (AC-3) is encoded at 448 Kbps for DVD and 320 Kbps for theatrical 35mm prints.

Desynchronization is easily avoided by clocking the signals using timecode. AC-3 encoded by a licensed Dolby Digital encoder typically has embedded timecode so that it can maintain frame synchronization with its corresponding program.

jbellanca
Feb 12, 2008, 01:58 PM
There's two plausible approaches:


Six channel AAC in an MPEG-4 container
AC3 WAV in Quicktime container



So, now that Take 2 is out, has anyone tested to see which way we should be going with 5.1 conversions? AAC or AC-3? (I can test both, but not until way later tonight.)

Cave Man
Feb 12, 2008, 02:25 PM
So, now that Take 2 is out, has anyone tested to see which way we should be going with 5.1 conversions? AAC or AC-3? (I can test both, but not until way later tonight.)

Someone is going to have to dl a movie, remove the ATV hard drive or afp to it, then dissect the movie to find out how DD is done.

Superman07
Feb 12, 2008, 02:41 PM
So, now that Take 2 is out, has anyone tested to see which way we should be going with 5.1 conversions? AAC or AC-3? (I can test both, but not until way later tonight.)

It's been less than an hour!! Are you expecting miracles?! :eek:

Cave Man
Feb 12, 2008, 02:43 PM
It's been less than an hour!! Are you expecting miracles?! :eek:

It should be pretty easy, just time consuming. DL a HD movie that has DD, then pull the ATV hard drive and mount it on a Mac and open the movie in QuickTime to see how the audio is encoded.

jbellanca
Feb 12, 2008, 02:49 PM
It's been less than an hour!! Are you expecting miracles?! :eek:

LOL, I have two files ready to test, one with AC3, one with 6-channel AAC... I'm just at the office right now and can't test them. (Yes, I'm impatient.)

BobVB
Feb 12, 2008, 04:39 PM
LOL, I have two files ready to test, one with AC3, one with 6-channel AAC... I'm just at the office right now and can't test them. (Yes, I'm impatient.)

I've tested an .mkv version of Serenity saved as a .mov which inspects properly (H.264 video, AC3 audio) and plays fine in Quicktime Player with Perian installed.


My AppleTV is connected to my Harmon Kardon receiver via HDMI and there is no audio detected - the audio channel inputs just flash, no sound on any configuration.

So for me a simple AC3 audio track is not passed thru.

Cave Man
Feb 12, 2008, 04:50 PM
LOL, I have two files ready to test, one with AC3, one with 6-channel AAC... I'm just at the office right now and can't test them. (Yes, I'm impatient.)

Your AC3 might work, but your AAC won't. Straight from the ATV2 spec page:

Audio formats supported
AAC (16 to 320 Kbps); protected AAC (from iTunes Store); MP3 (16 to 320 Kbps); MP3 VBR; Apple Lossless; AIFF; WAV; Dolby Digital 5.1 surround sound pass-through

See the post 110 (http://forums.macrumors.com/showthread.php?t=387209&page=5) for a suggestion.

darkpixie08
Feb 12, 2008, 04:54 PM
From the handbrake forums:

bitsflew wrote:
AC3 in a mov container works!

Here is how I did it:

Open an existing mp4 (I used a handbrake rip) file in QT player.
Open an ac3 soundtrack in QT player.
Paste the ac3 soundtrack into the mp4 file
Export the movie as a self contained Quicktime movie.
Import the movie in iTunes.

Looks like they're making some headway.

BobVB
Feb 12, 2008, 04:58 PM
From the handbrake forums:

bitsflew wrote:
AC3 in a mov container works!

Here is how I did it:

Open an existing mp4 (I used a handbrake rip) file in QT player.
Open an ac3 soundtrack in QT player.
Paste the ac3 soundtrack into the mp4 file
Export the movie as a self contained Quicktime movie.
Import the movie in iTunes.

Looks like they're making some headway.


Makes me wonder though - that file would have two audio tracks, the original and the AC3 - if the AC3 file is actually being played then why is my .mov file with just an AC3 file silent? Is the person sure that they aren't just hearing the Dolby Pro Logic II (or whatever) audio track and not the AC3?

JasonKerner
Feb 12, 2008, 05:04 PM
Maybe by AC3 passthrough what Apple mean is that its not discrete sound, as in six seperate cables.

What I think might by happening is that the six channel AC3 is being encoded on the fly to AC3 and sent out the optical jack. This would still make it work on normal stereo systems. The 'passthrough' is that the Apple TV is passing through the AC3 signal to the amp to decode, rather than the Apple TV decoding it.

I'll bet its six channel AAC and they're might be an option in Apple TV's audio menus now to turn Dolby Digital on or off

(haven't checked myself yet, update it still downloading)

Jason

BobVB
Feb 12, 2008, 06:06 PM
I'll bet its six channel AAC and they're might be an option in Apple TV's audio menus now to turn Dolby Digital on or off

No just encoded a 6 discrete channel movie segment and it plays back as a 2 channel Pro Logic II just as its always done.

My fear now is that Apple has done something proprietary so that only their HD movies can playback DD5.1 :(

petvas
Feb 12, 2008, 06:25 PM
Makes me wonder though - that file would have two audio tracks, the original and the AC3 - if the AC3 file is actually being played then why is my .mov file with just an AC3 file silent? Is the person sure that they aren't just hearing the Dolby Pro Logic II (or whatever) audio track and not the AC3?

I am sure! The only problem is that audio is out of sync.

BobVB
Feb 12, 2008, 06:32 PM
I am sure! The only problem is that audio is out of sync.

Hmmm I wonder why the perian-saved QT movie doesn't work then? Especially puzzling considering the QT Movie Properties window easily recognizes it as an AC3 audio track. Do you remove the AAC track so that there is only the AC3?

EvilRob
Feb 12, 2008, 06:39 PM
Six channel AAC is not transcoded into AC3 in the AppleTV 2.0 software. It plays as Dolby ProLogic II. Presumably Apple choked on licensing Dolby Live.

The Apple-provided movies appear to have a stereo audio stream and a private AC3 stream as well, in an MPEG-4 container. The ID of these streams is used by the AppleTV to determine which to play.

csimon2
Feb 12, 2008, 06:42 PM
My bet on how Apple is accomplishing this:
a) They are using an MPEG-2 Transport stream to mux the h264 and ac3 tracks together and deliver to the AppleTV. If the new aTV sw can now recognize a transport stream file and decode the h264 video and passthrough the ac3 to an external decoder, then this would be the most efficient way of going about this.
b) They are doing what has been described previously in that they have encoded an ac3 bitstream into a PCM compatible audio layer and muxed that with the h264 video. Note that this would be different than just taking an elementary stream ac3 file and opening it up in QT and pasting it into a h264 encoding .mov and then saving as a new file.
c) They are encoding to aac 5.1 and delivering to the box as aac 5.1, but when the file is played back the 5.1 channels are decoded and sent out as a compliant ac3 stream which can be decoded by a receiver. I really don't see this as being a likely solution however as this can easily introduce noticable syncing delays.

My company is focused on encoding needs for next generation systems, and we do lots of encoding and setup for IPTV and game consoles. For IPTV, the standard method of encoding for the set top boxes being deployed is similar to a). This method is also the preferred way to get the PS3 to use h264 video and multichannel audio. Since ac3 decoders are so prevalent in home theater setups, this method of encoding is far superior to encoding to a standard mp4 which cannot support ac3 (and there are very few multichannel aac dsp's available in the home theater market today that could support 5.1 aac digital decoding).

Option b) would sound less likely to me, but since its Apple, who knows? Maybe they just really like QT... But from everything that I heard recently, Apple really is focusing less on QT and the .mov format and more on the making QT a truly robust platform for .mp4 and h264 encoding/playback. I don't think that they are currently anywhere close to achieving this goal, and doing something like this would seem counterintuitive.

BobVB
Feb 12, 2008, 06:44 PM
Six channel AAC is not transcoded into AC3 in the AppleTV 2.0 software. It plays as Dolby ProLogic II. Presumably Apple choked on licensing Dolby Live.

The Apple-provided movies appear to have a stereo audio stream and a private AC3 stream as well, in an MPEG-4 container. The ID of these streams is used by the AppleTV to determine which to play.

On a technical note, I thought the whole problem was you CAN'T have an AC3 stream inside of a technically correct MPEG-4 container, i.e. there is no such animal.

And is the ID something consistent? Can I go in and rename my AC3 audio track to some standard name so it will be picked up by AppleTV?

csimon2
Feb 12, 2008, 07:06 PM
On a technical note, I thought the whole problem was you CAN'T have an AC3 stream inside of a technically correct MPEG-4 container, i.e. there is no such animal. Technically, you are correct in that an AC-3 elementary stream cannot be muxed into a MPEG-4 MP4 compliant file. However, there is a method for storing AC-3 inside of PCM audio (this method is pretty common for sending AC-3 audio in a SDI embedded stream). If Apple is using this method to store the AC-3 in a private PCM audio track inside a MP4 muxed file, then this could possibly be considered legal.

BobVB
Feb 12, 2008, 07:21 PM
Technically, you are correct in that an AC-3 elementary stream cannot be muxed into a MPEG-4 MP4 compliant file. However, there is a method for storing AC-3 inside of PCM audio (this method is pretty common for sending AC-3 audio in a SDI embedded stream). If Apple is using this method to store the AC-3 in a private PCM audio track inside a MP4 muxed file, then this could possibly be considered legal.

But if so, why would there be reports of 'cut and paste' AC3 audio tracks into a .mov container working?

I haven't gone to the effort of doing the quicktime 'cut and paste' yet, but I do know that a Perian-enabled QT save of an .mkv format file into .mov does NOT work (someone else has reported that in the HandBrake forums).

There is the new AppleTV audio setting of 'Dolby Digital Out' of off or on - is it that the track just has to be the right name? The default in the Perian save is the standard 'Audio Track' for the AC3. When you do a cut and pastes is that somehow different?

petvas
Feb 12, 2008, 07:31 PM
http://www.isquint.org/cgi-bin/ikonboard.cgi?act=ST;f=8;t=4990;st=0;r=1;&#entry24231

Visual Hub 1.31 is coming tomorrow with DD5.1 Support for AppleTV

They are creating a mov file to support DD5.1, just as I posted before

gopher
Feb 12, 2008, 08:08 PM
5.1 audio is coming out on Handbrake Version 0.7.1 (2006022400) converted videos where the AC3 track was encoded with the video. I didn't have to do any copy/paste. It just worked. I have a Logitech Z-680 hooked up to my AppleTV.

Superman07
Feb 12, 2008, 08:34 PM
What the diff between VisHub and Handbreak?

gopher
Feb 12, 2008, 08:37 PM
Last I checked Handbrake was free, and VisualHub costs extra money. I found with the demo I couldn't control the aspect ratio of the video and it was harder to set settings just right for AppleTV.

EvilRob
Feb 12, 2008, 08:37 PM
But if so, why would there be reports of 'cut and paste' AC3 audio tracks into a .mov container working?

Because a Quicktime MOV container and an MPEG-4 container are not the same thing. There are strict rules on what the public streams in an MPEG-4 container must contain.

The Quicktime MOV container has no such rules, and permits you to jam all manner of crazy data into it, including an AC3 audio track.

BobVB
Feb 12, 2008, 08:43 PM
Because a Quicktime MOV container and an MPEG-4 container are not the same thing. There are strict rules on what the public streams in an MPEG-4 container must contain.

The Quicktime MOV container has no such rules, and permits you to jam all manner of crazy data into it, including an AC3 audio track.

You misunderstood my question: if the mp4 container method was required, why would the .movs be working....

But we now know from the demo VisualHub .mov file that an AC3 stream will work. Either the Handbrake .mkv AC3 settings are inherently incompatible or Perian does something when it saves the movie as a .mov tom make the AC3 track unavailable to AppleTV.

gopher
Feb 12, 2008, 08:46 PM
Still it Handbrake is able to add AC3 audio tracks from a movie DVD that has had them encoded to an M4V file which AppleTV will then recognize and output as 5.1 sound. I've tested and proven this myself.

BobVB
Feb 12, 2008, 08:51 PM
Still it Handbrake is able to add AC3 audio tracks from a movie DVD that has had them encoded to an M4V file which AppleTV will then recognize and output as 5.1 sound. I've tested and proven this myself.

well my copy of Handbrake 0.9.1 won't let me do that and I don't have one as old as 0.7.1. Mine only allows Dolby Prologic II in MP4 files and the AC3 passthru of .MKV files aren't recognized by iTunes.

EvilRob
Feb 12, 2008, 08:57 PM
You misunderstood my question: if the mp4 container method was required, why would the .movs be working...

They're not mutually exclusive. There are three different things we know work:


Quicktime MOV containers with appropriately named and prepared AC3 audio streams work. We know this because there are working samples, including the VisualHub sample file.
Quicktime MOV containers with with a losslessly encoded AC3 PCM stream work. We know this because it's worked since AppleTV 1.0.

MPEG-4 containers with an appropriately named and prepared AC3 audio stream work. We know this because this is the format that the Apple movies with AC3 use. Incidentally, the Apple movies store the AC3 track in a private stream, and put a normal stereo track into the audio stream, thus making a legal MPEG-4 file.


Does that answer your question?

BobVB
Feb 12, 2008, 08:59 PM
They're not mutually exclusive. There are three different things we know work:


Quicktime MOV containers with appropriately named and prepared AC3 audio streams work. We know this because there are working samples, including the VisualHub sample file.
Quicktime MOV containers with with a losslessly encoded AC3 PCM stream work. We know this because it's worked since AppleTV 1.0.

MPEG-4 containers with an appropriately named and prepared AC3 audio stream work. We know this because this is the format that the Apple movies with AC3 use. Incidentally, the Apple movies store the AC3 track in a private stream, and put a normal stereo track into the audio stream, thus making a legal MPEG-4 file.


Does that answer your question?

Actually if you read my note you realize I no longer had any of those questions. ;) My only one now is how to get an AppleTV playable file out of Handbrake.

gopher
Feb 12, 2008, 09:22 PM
Looks like downgrading Handbrake may be the only option unless you can get these settings out of the newer versions. As I saw a newer version of Handbrake came out, my encoded files were not encoded as well, were choppier, or Handbrake unexpectedly quit in the middle of encoding.
These settings I used with my version of Handbrake:

Average Bitrate 1800 kbps
Sample rate 48000 Hz
Bitrate 128 kbps
File Format MP4
Codec AVC/H.264 Video/AAC Audio
Audio Language AC3, or Dolby II/Digital

BobVB
Feb 12, 2008, 10:45 PM
Looks like downgrading Handbrake may be the only option unless you can get these settings out of the newer versions. As I saw a newer version of Handbrake came out, my encoded files were not encoded as well, were choppier, or Handbrake unexpectedly quit in the middle of encoding.

Well I found a copy of Handbrake 0.7.1 and I found the settings are only about the source. It gives you no choice of the output which is 2 channel AAC for the MP4 selection.

Open one of the files you created in Quicktime Player and use the Movie Inspector - you will see that the sound is just a 2 channel AAC track.

csimon2
Feb 12, 2008, 11:50 PM
But if so, why would there be reports of 'cut and paste' AC3 audio tracks into a .mov container working? Dunno. :confused: Did this work with the 1.x version of aTV sw? I don't have an aTV so I am really just speculating off of what I know to work in most other environments where H264 and AC-3 have to be married into a single file. I thought I had read though that people reported that this method wasn't working. But if this has been enabled from the beginning, then I don't know why more people weren't targetting this method. I know I would have been at least. Either the Handbrake .mkv AC3 settings are inherently incompatible or Perian does something when it saves the movie as a .mov to make the AC3 track unavailable to AppleTV. Most likely answer is that with the default version aTV sw, mkv isn't recognized properly. And when you are saving as a .mov directly to from a .mkv, there is either some header information in the way or not present that aTV expects. Have you ever tried the following?: Use MKVExtract to extract the H264 to a .264 and the AC-3 to a .ac3 elementary stream
Use YAMB to mux the .h264 to a .mp4
Open the h264 .mp4 and ac-3 .ac3 in QT and then copy and paste those two tracks into a newly saved .mov file They're not mutually exclusive... There are three different things we know work: Thanks for the roundup. So, I had some followup questions, in respective order to your list. (This aTV update and price drop has finally got me to consider getting one.): I assume that this is going to work with the default version of the aTV sw? No hacking required?
What sw was used that was capable of doing this before? Just curious...
So it sounds like what Apple is officially doing for their rentals is .mp4 with stereo aac and private ac3. Correct?

EvilRob
Feb 13, 2008, 12:52 AM
Thanks for the roundup. So, I had some followup questions, in respective order to your list. (This aTV update and price drop has finally got me to consider getting one.):

I assume that this is going to work with the default version of the aTV sw? No hacking required?

Yes, this works with the default software. I'm willing to hack my own AppleTV, but I want something that works for friends and family as well.

What sw was used that was capable of doing this before? Just curious...

The only one that worked prior to AppleTV 2.0 was number 2 from my list, the losslessly encoded AC3 track. There was no easy software to do that, you had to extract the AC3 track and encode it yourself, then mux it back into the file to be played. It was ugly. ;-)

So it sounds like what Apple is officially doing for their rentals is .mp4 with stereo aac and private ac3. Correct?

Yes, that's correct. There may be more than just stereo in the AAC soundtrack (ie. ProLogic II), but that's what is inside the MPEG-4 containers from Apple. If you want a close look at one without the DRM baggage from a rental, the new AppleTV intro movie is also in this format and can be extracted from the update image, which can be downloaded with some hackery.

BobVB
Feb 14, 2008, 01:00 AM
There is a patch in the HB source that allows for the creation of mp4 with AC-3 passthru. Did a test compile and it does work.

This does NOT create a file like the HD rentals that have a Pro Logic II and a DD5.1 audio track which could possibly come in the future.

dynaflash
Feb 14, 2008, 08:23 AM
... which could possibly come in the future.
very possibly

Cave Man
Feb 14, 2008, 10:18 AM
very possibly

dyna, you're such a tease. :)

dynaflash
Feb 14, 2008, 11:21 AM
;)