Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

FleurDuMal

macrumors 68000
Original poster
May 31, 2006
1,801
0
London Town
Hey,

I'm just messing around with Handbrake and decided to encode a chapter of a movie in H.264 with AC-3 audio inside an AVI file. VLC plays the file just fine, but Quicktime flat out refuses to play it. I just get "Error Opening File" every time.

I have Perian and Flip4Mac components installed in my Quicktime folder. I have heard that sometimes the audio wont play, and I know that it won't play in 5.1, but it should at least be able to open the file?!?
 

mklos

macrumors 68000
Dec 4, 2002
1,896
0
My house!
Its probably requiring some kind of special codec to function properly. Normally .avi files aren't QuickTime friendly. I use VLC mostly for .avi files.
 

Makosuke

macrumors 604
Aug 15, 2001
6,662
1,242
The Cool Part of CA, USA
AVI, like MOV, is just a container format--you can put just about any kind of video and audio into it. Quicktime should know what to do with AVI containers, even if it's totally unable to play the particular video formats.

When I fire up Handbrake and encode a quick test file using AVI container with H.264 video and AC3 sound, I get the error I expect--it says it can't play the codecs, but I at least get a blank window (I believe QT doesn't know how to handle H.264 video in an AVI container, and I don't have the AC3 plug in installed).

However, this sounds different. If it won't even open the file, it's usually because it's NOT an AVI--most often a mis-labeled OGM file. Assuming you didn't accidentally select the wrong format in Handbrake, I don't know why you'd be getting that error. Were handbrake encoding something that isn't "technically" legal as an AVI file, Quicktime might be more picky than VLC and reject it, but it sure doesn't when I do the same thing...
 

TEG

macrumors 604
Jan 21, 2002
6,621
169
Langley, Washington
Quicktime only opens .avi files on Windows, because it can draw on the WMP libraries to play the files. On Macintosh, there were only a few ways to play .avi files, but it was only for those of the MS-MPEG4 Variety (early DiVX). Nowadays you have to use VLC or Mplayer to play .avi files. It has nothing to do with Flip4Mac, that only works on .wmv and .wma files.

TEG
 

FleurDuMal

macrumors 68000
Original poster
May 31, 2006
1,801
0
London Town
AVI, like MOV, is just a container format--you can put just about any kind of video and audio into it. Quicktime should know what to do with AVI containers, even if it's totally unable to play the particular video formats.

When I fire up Handbrake and encode a quick test file using AVI container with H.264 video and AC3 sound, I get the error I expect--it says it can't play the codecs, but I at least get a blank window (I believe QT doesn't know how to handle H.264 video in an AVI container, and I don't have the AC3 plug in installed).

However, this sounds different. If it won't even open the file, it's usually because it's NOT an AVI--most often a mis-labeled OGM file. Assuming you didn't accidentally select the wrong format in Handbrake, I don't know why you'd be getting that error. Were handbrake encoding something that isn't "technically" legal as an AVI file, Quicktime might be more picky than VLC and reject it, but it sure doesn't when I do the same thing...

Well, the strange thing is is that at first when I tried to open the AVI file at first it would throw up some blurb about codecs, and a window did open but all that was in the window was a white screen, and no sound played. However, I then installed the Perian codec and now it won't even open the file :confused:

FYI, this is a Handbrake file that I encoded from a DVD that was ripped onto my hard drive using MacTheRipper - so all copy protection should have been wiped from it (and I do own the original DVD, so I'm not trying to do anything I should :p ).
 

Makosuke

macrumors 604
Aug 15, 2001
6,662
1,242
The Cool Part of CA, USA
However, I then installed the Perian codec and now it won't even open the file :confused:
Ok, that's probably the issue; I'm not familiar with that codec, but I'd be willing to bet that it tries to override QT's default handling of AVI files but can't deal with that or just doesn't work the way it was intended. Have you tried removing it? I expect it will go back to the original behavior if you do.

Quicktime only opens .avi files on Windows, because it can draw on the WMP libraries to play the files.
I disagree with this; QT on OSX has for some time and still does know how to read AVI containers, it just often doesn't have codecs to support the video formats people use. With the DivX codec, however, it will play most files with DivX or XviD video and MP3 audio, which are (or were) by far the most common.

QT WON'T play asx/wmv files, but that's because those use a container other than AVI and MS-specific codecs that QT doesn't have. Flip4Mac, however, adds support for the asx container format to QT and at least some of the video and audio codecs, so (at least in my experience) it allows me to use QT to view almost any WMV file so long as it doesn't use copy protection.
 

Yuvi

macrumors member
Jun 27, 2006
64
0
The problem with AVI isn't so much that it can store any kind of codec, but rather that the vast majority of files break the spec in a variety of ways. B-frames, vbr, audio packets being cut randomly, garbage inserted into tracks, the index not reflecting the contents of the file, channel counts usually not including the LFE channel, storing vorbis inside of ogg inside of avi, aac being stored both with and without adts headers, ssa, the list goes on. The main reason that VLC can cope with all of this better than QuickTime is that its users have reported to the developers the wide range of AVI files that didn't work, and the developers fixed them. Apple never had much motivation to fix these files, and that's why Perian exists now.

To FleurDuMal, make sure that you have A52Codec (http://trac.cod3r.com/a52codec) installed. Perian 0.5 has a bug that prevents it from opening AVIs with AC3 audio without a decoder installed (fixed in svn.)
 

FleurDuMal

macrumors 68000
Original poster
May 31, 2006
1,801
0
London Town
To FleurDuMal, make sure that you have A52Codec (http://trac.cod3r.com/a52codec) installed. Perian 0.5 has a bug that prevents it from opening AVIs with AC3 audio without a decoder installed (fixed in svn.)

Aha! That appears to have done the trick. It's working just fine now.

However, all my work appears to have been in vain as iTunes appears not to like AVI files either and won't add them to my library. All I wanted was to find a way to get AC3 audio on the movies I've ripped and encoded to my hard drive in a way that will work with iTunes/Front Row. I know that even if I had found a way, Quicktime would just downmix 5.1 AC3 to 2 channel, but it would have been nice just to future proof it for a time when Appl fix that bug (and I'm sure they will before :apple: TV comes out).

Damn! :(
 

Yuvi

macrumors member
Jun 27, 2006
64
0
However, all my work appears to have been in vain as iTunes appears not to like AVI files either and won't add them to my library. All I wanted was to find a way to get AC3 audio on the movies I've ripped and encoded to my hard drive in a way that will work with iTunes/Front Row. I know that even if I had found a way, Quicktime would just downmix 5.1 AC3 to 2 channel, but it would have been nice just to future proof it for a time when Appl fix that bug (and I'm sure they will before :apple: TV comes out).

Two ways I know of to get AVIs into iTunes, both requiring QuickTime Pro. First is to open the movie into QuickTime pro, then save the movie as a reference movie (~1mb) and add the reference movie to iTunes. Second is to export it as a "QuickTime Media Link", which is about 4k. I don't really use either method myself, but I think there's a script somewhere to do this automatically.

As for 5.1 output, the forced downmixing was partially a leftover from when the only AC3 decoder for QuickTime couldn't handle more than 2 channels, which itself was due to limitations pre-QT7. Perian recently fixed this restriction, but it won't do much unless you have a analog 5.1 sound card. Apple doesn't seem to be all that concerned about AC3 passthrough over SPDIF in QuickTime (make an enhancement request, maybe they'll change their mind if enough people do it), although maybe a virtual sound device + realtime ac3 encoder might be programmed eventually for much the same effect. And I personally don't think Apple will support 5.1 output from the AppleTV.

EDIT: Well, I just unexpectedly learned that HDMI has enough bandwidth for 5.1 PCM (I had always thought it was essentially SPDIF in HDMI), so maybe Apple will support 5.1 output through HDMI in the Apple TV.
 

FleurDuMal

macrumors 68000
Original poster
May 31, 2006
1,801
0
London Town
EDIT: Well, I just unexpectedly learned that HDMI has enough bandwidth for 5.1 PCM (I had always thought it was essentially SPDIF in HDMI), so maybe Apple will support 5.1 output through HDMI in the Apple TV.

Maybe I'm mistaken, but the HDMI out port on :apple: TV will have very little to do with 5.1 audio? I would have though that to get 5.1 audio there would have to be an digital optical cable to a receiver with a 5.1 decoder onboard, and that the HDMI will just carry the picture?

I'm still harbouring dreams that iTunes 8 will be released with Leopard and/or :apple: TV with integrated DVD ripping and encoding - video in H.264 and audio in AAC or FLAC. Until that's the case, I simply don't see :apple: TV being a success. Apple may see it as a Trojan horse for their movie and TV show downloads from iTunes, but I doubt that'll work much in the same way the iPod wouldn't have been a success if you couldn't load music you'd ripped from CD's onto it.
 

Yuvi

macrumors member
Jun 27, 2006
64
0
Maybe I'm mistaken, but the HDMI out port on :apple: TV will have very little to do with 5.1 audio? I would have though that to get 5.1 audio there would have to be an digital optical cable to a receiver with a 5.1 decoder onboard, and that the HDMI will just carry the picture?

Yes, 5.1 audio can be transmitted over digital optical audio connection. However, only in compressed AC3 or DTS format. Since these two formats are the only way to get multichannel audio on a DVD, optical cables work well for multichannel audio from DVDs since the data can just be passed directly to the receiver to decode. However, Apple chose AAC to compress all of the audio they sell through iTunes, including the audio tracks for the video it sells. This can't be passed over the optical cable since receivers wouldn't know what to do with AAC. Thus, the audio would have to be converted to AC3, which would involve Apple licensing an AC3 or DTS encoder. It's not impossible for Apple to do this, but I just don't see them doing it due to the high (in my estimation) effort/demand ratio.

As for your own files that you're creating, they could in theory be passed straight through the optical port (DVD player and VLC will do this), except for my previous mention of Apple's expressed indifference to such an possibility through QuickTime. Again, the more people request this from Apple the more likely it will become a reality.

Also, the situation becomes more complex when dealing with HD-DVDs and Blu-Ray discs. Since the movie industry has deemed SPDIF ports not secure enough to transfer their content, they have to be restricted from playing full-quality audio from either format. Though this won't matter too much anyways since they support new codecs that can't be passed over SPDIF natively anyways (unless they require the SPDIF port be disabled entirely, I'm still unclear as to whether that's the case.) Which brings us back to HDMI - I was actually looking at one of the new audio codecs supported, E-AC3, when I read that HDMI 1.3 was the only connection interface that had enough bandwidth for its maximum bitrate of 6144 kbit/s (almost 10x the maximum bitrate of normal AC3.) HDMI has always specified support for both audio and video, though it's rapidly evolved in the last couple years and not too many receivers support any type of audio over HDMI at the moment, let alone the new codecs.

Anyhow, Leopard around's the corner and will likely support HD-DVD and Blu-Ray, both of which mix up multichannel audio yet again (and their DRM makes it unclear how well current optical/coax SPDIF ports will be supported.) As such, I don't really see Apple doing much about multichannel audio out for now, especially for a device such as the AppleTV.

I'm still harbouring dreams that iTunes 8 will be released with Leopard and/or :apple: TV with integrated DVD ripping and encoding - video in H.264 and audio in AAC or FLAC. Until that's the case, I simply don't see :apple: TV being a success. Apple may see it as a Trojan horse for their movie and TV show downloads from iTunes, but I doubt that'll work much in the same way the iPod wouldn't have been a success if you couldn't load music you'd ripped from CD's onto it.

Given the tendency of products and services that rip/copy DVDs to be sued into oblivion (especially in the US and UK), I don't see Apple doing this anytime soon. CDs were fine since no CD compliant to the Red Book spec has copy protection to remove (CDs that have copy protection aren't allowed to bear the audio CD trademark.)
 

Stylez

macrumors newbie
Jan 20, 2007
17
0
Yes, 5.1 audio can be transmitted over digital optical audio connection. However, only in compressed AC3 or DTS format. Since these two formats are the only way to get multichannel audio on a DVD, optical cables work well for multichannel audio from DVDs since the data can just be passed directly to the receiver to decode. However, Apple chose AAC to compress all of the audio they sell through iTunes, including the audio tracks for the video it sells. This can't be passed over the optical cable since receivers wouldn't know what to do with AAC. Thus, the audio would have to be converted to AC3, which would involve Apple licensing an AC3 or DTS encoder. It's not impossible for Apple to do this, but I just don't see them doing it due to the high (in my estimation) effort/demand ratio.

As for your own files that you're creating, they could in theory be passed straight through the optical port (DVD player and VLC will do this), except for my previous mention of Apple's expressed indifference to such an possibility through QuickTime. Again, the more people request this from Apple the more likely it will become a reality.

Also, the situation becomes more complex when dealing with HD-DVDs and Blu-Ray discs. Since the movie industry has deemed SPDIF ports not secure enough to transfer their content, they have to be restricted from playing full-quality audio from either format. Though this won't matter too much anyways since they support new codecs that can't be passed over SPDIF natively anyways (unless they require the SPDIF port be disabled entirely, I'm still unclear as to whether that's the case.) Which brings us back to HDMI - I was actually looking at one of the new audio codecs supported, E-AC3, when I read that HDMI 1.3 was the only connection interface that had enough bandwidth for its maximum bitrate of 6144 kbit/s (almost 10x the maximum bitrate of normal AC3.) HDMI has always specified support for both audio and video, though it's rapidly evolved in the last couple years and not too many receivers support any type of audio over HDMI at the moment, let alone the new codecs.

Anyhow, Leopard around's the corner and will likely support HD-DVD and Blu-Ray, both of which mix up multichannel audio yet again (and their DRM makes it unclear how well current optical/coax SPDIF ports will be supported.) As such, I don't really see Apple doing much about multichannel audio out for now, especially for a device such as the AppleTV.



Given the tendency of products and services that rip/copy DVDs to be sued into oblivion (especially in the US and UK), I don't see Apple doing this anytime soon. CDs were fine since no CD compliant to the Red Book spec has copy protection to remove (CDs that have copy protection aren't allowed to bear the audio CD trademark.)


So, If I understand correctly, passing on 5.1 to a receiver will only work with VLC or other players that support it?
Question: can you tell front row what player to use - vlc or others?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.