When the Apple TV came out I rushed to buy one. Technology Evangelist
shoots all our videos in 1080p and distributes 480p, 720p and 1080p versions of
our material. On paper it looked like our stuff would work, but you never
know until you try, right? To my delight everything worked as it should
and I was able to see our material in all it's 720p glory. After watching
the content a bit I noticed a few areas we could improve in our encoding, so I
set out to create new encoding profiles. Since the Apple TV supports the
h.264 main profile using CAVLC I figured I would use that. Turns out that
Apple TV does not seem to like CAVLC so much.
So what the heck is CAVLC and why do we care? CAVLC and CABAC are methods
of encoding video using the h.264 CODEC that allows for lossless
compression. Apple TV does not support CABAC so I'll ignore that for the
sake of this article. CAVLC stands for Context-Adaptive Variable
Length Encoding and is part of the main and high profiles in h.264. There
are many profiles but we basically concentrate on three: baseline, main
and high. Baseline is the entry level profile designed for low end
encoding for things like cell phones, or devices without hardware supported
rendering (I'm generalizing here). Until now we have been forced to use
baseline h.264 profiles since the iPod didn't support anything higher than
that. The second one, main profile is a step up and allows us to select
longer GOP structures (how many real frames vs. virtual frames we use) as well
as CAVLC or CABAC encoding. Main profile is basically for broadcast TV and
slightly higher-end applications allowing for more complex decoding of the file.
And then high profile takes it a step further and allows things like color space
(4:2:0, 4:2:2, etc) and is designed more for broadcast archiving of files or
really high-quality video at higher bitrates. When I read that Apple TV
supported main profile CAVLC I was excited because now I would be able to update
my encoding presets to take advantage of what the higher profile had to
offer. Since CAVLC is a lossless compression technique I was hoping I
could get a little more quality out of our videos at the same or maybe less
bitrate. Things like solid blacks were breaking up before, I thought this
may fix it. CAVLC looks great, but it has some pretty serious problems on
the Apple TV.
Our original videos have all been encoded up to this point using Sorenson
Squeeze 4.5 as an h.264 baseline profile. I have wanted to upgrade to the
main profile CAVLC but Squeeze isn't very good at actually setting that
up. Recently we purchased Telestream's Episode Pro to help improve our
workflow, get Apple iPod and Sony PSP support as well as give us more CODEC
options. I ran a couple of test encodes using Episode Pro as an MPEG 4
h.264 main profile CAVLC encode and the files looked stunning. I was
excited to try these on the Apple TV so I added them to my iTunes library.
They all popped over to the Apple TV no problem. I then went to my Apple
TV, selected the first file, and the whole unit stalled. After about 60 to
90 seconds the Apple TV responded again and I could move to the next video in
the list or play the CAVLC encoded file. If I hit play then I would have
to wait another 60 to 90 seconds before the file would begin to play. Once
it started playing everything seemed to work fine, and it looked stunning.
The problem is that I can't have our content causing everyone's Apple TV to
stall out every time they pass over a clip! If I take that exact same clip
and don't change any settings other than moving it to a baseline profile, then
it will work fine on the Apple TV. Nice and snappy.
I heard rumors that the new QuickTime Export to Apple TV feature used CAVLC to
encode, but I have no way to test and see how it's really encoding yet. I
ran a test encode and content that spits out of QuickTime Pro is nice and snappy
as well, so I'll assume that they are using a baseline profile. Has anyone
else seen this problem or have any ideas how I can troubleshoot something of
this nature? I posted to the Apple support forum, but that has gone
unanswered. I want to be able to deliver our content to everyone using the
least amount of bandwidth at the highest possible quality. Anything I can
do to improve upon the videos is welcome, but having the video lock the Apple TV
for a minute or two is not an acceptable solution.
If you would like to see exactly what I'm talking about, I have uploaded our
test clips to the MoveDigital network. You can download each clip (there
are multiple clip settings for b-frames, bitrate, etc) at:
http://www.movedigital.com/go/benjaminhigginbotham/58340.
The first video in there is a baseline video which should work, the rest are all
main profile CAVLC. Right now I just need to determine if it's an Apple TV
issue or Telestream's implementation of h.264 that's causing the problem.
If anyone is able to re-compress the videos and try a CAVLC encode, it would be
greatly appreciated.
1. Posted by: anonymous on April 4, 2007 9:35 AM:
FYI:
Baseline supports CAVLC
Main supports CAVLC & CABAC
High supports CAVLC & CABAC
Maybe you mean CABAC, but in most cases an entropy encoding mode either completely works or doesn't unless the processor is running out of time. My guess is you may be having problems with the Main Profile due to B slices or one of the direct prediction modes that isn't completely supported.