Apple TV 2

Discuss encoding for devices and presets.
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.
Gavsta
Posts: 1
Joined: Mon Sep 27, 2010 8:56 pm

Apple TV 2

Post by Gavsta »

Hi,

I see that handbrake has a preset for Apple TV, is there one available for Apple TV 2, or will the original suffice for transcoding movies for that format?

Gavin.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: Apple TV 2

Post by TedJ »

Considering the ATV2 is based on the same A4 CPU platform as the iPhone 4 and iPad, it is far more capable than the previous model. As such, the general consensus is that the High Profile preset will be a good starting point for this device. We'll know more when some of our regulars receive their ATV2's and can perform testing on them.

Moving to Devices.
Terc
Posts: 40
Joined: Wed May 28, 2008 6:15 am

Re: Apple TV 2

Post by Terc »

I'm working on settings right this minute. As a side note, these settings will probably also be great for the iPhone 4 as long as battery life is not a concern.

Also, I've noticed that my settings I've been using for the last 60 encodes or so will work, but my iPhone 4 won't sync if there's only an ac3 track. Is there some way to add in a stereo mp3 track without re-encoding all the video? This would be a lifesaver.
User avatar
Rodeo
HandBrake Team
Posts: 12729
Joined: Tue Mar 03, 2009 8:55 pm

Re: Apple TV 2

Post by Rodeo »

Terc wrote:I'm working on settings right this minute. As a side note, these settings will probably also be great for the iPhone 4 as long as battery life is not a concern.

Also, I've noticed that my settings I've been using for the last 60 encodes or so will work, but my iPhone 4 won't sync if there's only an ac3 track. Is there some way to add in a stereo mp3 track without re-encoding all the video? This would be a lifesaver.
Your settings will probably be excellent! As a side note, did you know that the iPhone doesn't support MP3 audio in an MP4 container?
Berylium
Posts: 23
Joined: Wed Apr 04, 2007 11:44 pm

Re: Apple TV 2

Post by Berylium »

Like Terc I’m running a variety of tests on my ATV2 to find its limits. One very interesting thing I’ve found so far is that iTunes accepts 1080p content and it can be streamed to the ATV2. In fact, the only thing I’ve been able to get the ATV to stumble on has been 1080p material.

With the original AppleTV you could not sync or stream anything higher resolution than 720p/25. And, obviously, Apple’s specs for the ATV2 say “H.264 video up to 720p, 30 frames per second, Main Profile level 3.1”. While Apple’s ATV specs are notoriously conservative I certainly did not expect the device to play 1080p content given Apple’s spec sheet and history with the ATV.

Unfortunately, there is a big question remaining. I do not have a 1080p television and the ATV2 does not have a setting I could find that allows you to select the resolution of its output (unlike the original ATV). So while I know the source is 1080p and the ATV2 accepts it I do not know if it actually outputs 1080p to the attached TV.

-berylium
AugieMendoza
Posts: 11
Joined: Thu Dec 24, 2009 2:08 am

Re: Apple TV 2

Post by AugieMendoza »

@Terc
You can convert your ac3 to aac and mux it back in with something like Subler... works great and is fast.

@Berylium
So let me get this straight... the AppleTV (2010) CAN stream 1080p content? As far as your output question... It could be that Apple has set it up to auto detect your max TV resolution via HDMI... My PS3 and some other devices don't ask, they just detect max res.
Diveflo
Posts: 4
Joined: Sun Apr 04, 2010 5:59 pm

Re: Apple TV 2

Post by Diveflo »

Oh damn you to hell...now I want one.

Let's be clear...what kind of 1080p content did you try? What bitrates etc.

And it really streamed to the ATV? iTunes didn't rebell?

Thanks a lot ;)
Berylium
Posts: 23
Joined: Wed Apr 04, 2007 11:44 pm

Re: Apple TV 2

Post by Berylium »

AugioMendoza,

Yes, the AppleTV 2 (2010) can stream 1080p content. And, yes, the AppleTV 2 could be smart enough to output to the highest possible resolution. It occurs to me the original AppleTV needed the option for resolution in Settings because it also had Component video output which would not be able to auto-sense resolution. However, while I think it is unlikely, I I would not be surprised to find that Apple had locked output to 720p. We just need someone with a 1080p television to test so we know for sure.

Diveflo,

I’m testing with three different scenes that are known to max bitrates in decoding. A waterfall and jungle landing scene from Avatar, the "birds scene" from Planet Earth Ep. 1, and the Eiffel Tower scene from G.I. Joe The Rise of COBRA. I am still trying to find optimal settings and will post more when I find them. Like the ATV1, 1080p encodes on the ATV2 will require vbv-maxrate and vbv-bufsize options to decode optimally.

-berylium
gnomeIsland
Posts: 1
Joined: Thu Sep 30, 2010 2:31 pm

Re: Apple TV 2

Post by gnomeIsland »

Diveflo wrote:Oh damn you to hell...now I want one.
. . .
Thanks a lot ;)
Ditto. But seriously thanks for trying/posting. This is a great find, even if it doesn't *display* 1080p but just streams and down-rezzes it.
HotDogWolf

Re: Apple TV 2

Post by HotDogWolf »

Terc wrote:I'm working on settings right this minute. As a side note, these settings will probably also be great for the iPhone 4 as long as battery life is not a concern.

Also, I've noticed that my settings I've been using for the last 60 encodes or so will work, but my iPhone 4 won't sync if there's only an ac3 track. Is there some way to add in a stereo mp3 track without re-encoding all the video? This would be a lifesaver.
The easiest way to do this is to use MKVTOOLS just passthrough the video and select AAC audio.
Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: Apple TV 2

Post by Firelight »

1080p would be a huge win. I would bump the vbv to the next highest level (4) ... that would be vbv-maxrate and vbv-bufsize at 20000. Then see what happens.
Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: Apple TV 2

Post by Firelight »

Reports from macrumors that the ATV is decoding 1080p but only outputting 720p. Also curious if the 1080p content being played by folks is playable or syncable to the iPad or iPhone 4 ... I feel like if the A4 was capable of this it would have been caught by now, so the new Apple TV being able to do it is a little surprising. Maybe Apple forgot to put limits in iTunes?
Berylium
Posts: 23
Joined: Wed Apr 04, 2007 11:44 pm

Re: Apple TV 2

Post by Berylium »

I’m continuing to test with 1080p encodes. This new ATV is extremely graceful at dropping frames, there’s none of the choppiness one finds when pushing the ATV1 beyond its limits. Often, you can only see the frame drops in your periphery vision. I know that my girlfriend did not notice it until I showed her a 720p encode that played perfectly.

Unfortunately, finding a worthwhile sweet spot for 1080p encodes is looking less and less likely. The ATV2 can handle 15Mbps+ average encodes at 720p without a problem but at 1080p, even on an encode that averages 9 Mbps, the bitrate spikes cause frame drops.

The best option I’ve found so far is HandBrake’s High Profile preset with RF=22 and vbv-maxrate=11000:vbv-bufsize=1900 but there are still frame drops here and there. Granted, I’m testing on worst case scenes. So while 1080p settings may not be viable for action movies it should handle dramas and comedies with aplomb.
Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: Apple TV 2

Post by Firelight »

It may not be the bitrate spikes per se but just simply tough scenes to decode. Basing a 1080p encode off the universal or original ATV profile would be worth testing just to narrow down what's happening.

I get mine today so will be playing around later.
Last edited by Firelight on Thu Sep 30, 2010 6:05 pm, edited 1 time in total.
User avatar
Rodeo
HandBrake Team
Posts: 12729
Joined: Tue Mar 03, 2009 8:55 pm

Re: Apple TV 2

Post by Rodeo »

Firelight wrote:Reports from macrumors that the ATV is decoding 1080p but only outputting 720p. Also curious if the 1080p content being played by folks is playable or syncable to the iPad or iPhone 4 ... I feel like if the A4 was capable of this it would have been caught by now, so the new Apple TV being able to do it is a little surprising. Maybe Apple forgot to put limits in iTunes?
iTunes will not let you sync anything beyond 720p (to an iPhone 4). Never tried streaming.
Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: Apple TV 2

Post by Firelight »

Rodeo wrote:
Firelight wrote:Reports from macrumors that the ATV is decoding 1080p but only outputting 720p. Also curious if the 1080p content being played by folks is playable or syncable to the iPad or iPhone 4 ... I feel like if the A4 was capable of this it would have been caught by now, so the new Apple TV being able to do it is a little surprising. Maybe Apple forgot to put limits in iTunes?
iTunes will not let you sync anything beyond 720p (to an iPhone 4). Never tried streaming.
A guy on macrumors has stated that if you sync content using GoodReader or AirSharing the iPad does in fact play 1080p m4v's. So apparently this has been around for a while, just not in any sort of supported state.
Terc
Posts: 40
Joined: Wed May 28, 2008 6:15 am

Re: Apple TV 2

Post by Terc »

Ok, here is my cpu intensive preset. It plays great on the iPhone 4, includes the ac3 track for perfect audio when attached to the surround system, and has a stereo 128kbps aac track 2 for playback on the iPhone 4/iPad/iPod Touch 4th gen (which is automatically selected on apple devices that won't play ac3!). Would anyone be so kind as to test this out on their new Apple TV? I'm especially interested in what happens with very high complexity scenes. I've tried both DVD and 720P resolutions with great results - both on my Mac Mini 1.6 core duo and on my iPhone 4, but no 1080P (which it sounds like wouldn't be output to any display anyways). I'm very impressed with the iPhone 4 chipset, amazing what it can do.

Here's the preset download link http://cl.ly/1eddcc79a70ace5dbfe9


Warning - This preset uses lots of high profile settings. It's going to take quite some time to encode. With my 3.33 quad core, I'm getting about 33fps average encode rates on 480P and 20 fps on 720P content. It's SLOW, but you're going to get relatively small files with very, very good quality video.
Diveflo
Posts: 4
Joined: Sun Apr 04, 2010 5:59 pm

Re: Apple TV 2

Post by Diveflo »

Berylium wrote: Diveflo,

I’m testing with three different scenes that are known to max bitrates in decoding. A waterfall and jungle landing scene from Avatar, the "birds scene" from Planet Earth Ep. 1, and the Eiffel Tower scene from G.I. Joe The Rise of COBRA. I am still trying to find optimal settings and will post more when I find them. Like the ATV1, 1080p encodes on the ATV2 will require vbv-maxrate and vbv-bufsize options to decode optimally.

-berylium
Thanks very much for keeping us posted. If they can jailbreak this thing and add the old "My Movies" and "My TV Shows" links in the main menu I'm sold ;)
User avatar
Rodeo
HandBrake Team
Posts: 12729
Joined: Tue Mar 03, 2009 8:55 pm

Re: Apple TV 2

Post by Rodeo »

Terc wrote:Here's the preset download link http://cl.ly/1eddcc79a70ace5dbfe9
So your advanced options are:

Code: Select all

ref=5:me=umh:b-adapt=2:weightp=0:direct=auto:no-fast-pskip=1:no-dct-decimate=1:merange=32:bframes=5:b-pyramid=1
All the devices you target (iPhone 4, iPod touch 4G, iPad, AppleTV 2) support weightp, so no need to disable it.

In 0.9.4, b-pyramid is disabled by default and remains disabled regardless of whether you actually enable it, unless you disable mbtree (the x264 build shipping with 0.9.4 doesn't support mbtree+b-pyramid). But mbtree is a lost more useful than b-pyramid, so there's no good reason to use b-pyramid in 0.9.4. In the nightly builds, b-pyramid is compatible with mbtree and is enabled by default.

merange 32 is a bit overkill (x264 presets veryslow and placebo only use 24). There are other things you could enable that would be more useful (higher subme, raise it to 8 or 9 - or 10 if you enable trellis 2 but that's very slow). You could also enable all partitions (analyse all).

no-fast-pskip is only enabled in x264 preset placebo. Its usefulness is very low compared to the speed hit.
Scott R
Regular User
Posts: 94
Joined: Wed Nov 07, 2007 5:03 am

Re: Apple TV 2

Post by Scott R »

If it adds any value...

1) In testing out some Handbrake encodes last week, I found that, as Rodeo indicated, I could import a 1080p m4v into iTunes, but it gave me an error if I tried to sync it over to my iPhone 4.

2) There are people complaining in the Apple TV (2010) support forum that their older TVs aren't working well with the new aTV. These are early HDMI-equipped TVs that do not support a 720p signal. The aTV documentation goes out of its way to state that the aTV requires a TV that is capable of receiving a 720p signal, and there are no options for scaling differently in the aTV menus. So my suspicion is that any 1080p content that Berylium's content is getting downscaled to 720p, but I'd love to be wrong.

Of course, if you can really play 1080p content at that resolution, you'll then need to decide whether you value that more than cross-compatibility with the iPhone 4 / iPad / newest iPod Touch, though Firelight's comments about GoodReader and AirSharing indicate that a workaround could exist for getting that content onto portable iOS devices.

Personally, if I'm going to go through the bother of downconverting things in Handbrake anyway, I'd probably opt for maintaining *supported* cross-compatibility with other A4 iOS devices, but I'll have to mull that over more.

FYI, local Apple stores are getting these in now. I just picked one up today that way.
Berylium
Posts: 23
Joined: Wed Apr 04, 2007 11:44 pm

Re: Apple TV 2

Post by Berylium »

Firelight,

I tried your suggestion of transcoding both scenes with the Apple Universal preset. Even without CABAC or B-Frames there were dropped frames. Now, these encodes were also the largest yet (the Planet Earth scene was 22 Mb/s average) so maybe that had something to do with it.

It’s weird, while there is some variation in all the different tests I’ve run I’d say the improvement or regression in any of them is in the 5% range. In other words, the ATV2 with the High Profile preset and RF=22 with moderate VBV settings can play these intense 1080p scenes at ~90% smoothness (90% of the time there are no dropped frames) but changing the settings even drastically does not affect the result by more than 5%. So in my best case tests I’m getting 95% smoothness, worst case I’m getting 85%. It leads me to believe that this is a bandwidth or buffer issue of some kind.

-Berylium
Berylium
Posts: 23
Joined: Wed Apr 04, 2007 11:44 pm

Re: Apple TV 2

Post by Berylium »

As for 720p content, the last transcode I ran was the following: HandBrake High Profile, 720p loose, RF 18, and the following x264 options: b-adapt=2:rc-lookahead=50:me=umh:subq=10:trellis=2:aq-strength=1.1:psy-rd=1.2,0.10:ref=4:bframes=4

This plays smooth as silk in all my test videos. I’m trying to think what more I would do to improve it. More B-Frames? More Reference Frames? I don’t believe lowering the RF below 18 is worthwhile but I’m open to suggestions.

-Berylium
Scott R
Regular User
Posts: 94
Joined: Wed Nov 07, 2007 5:03 am

Re: Apple TV 2

Post by Scott R »

OK, so it took my only about 5 minutes to get my aTV out of the box and completely set up, including setting up my Home Sharing and signing into my Netflix account. Using the on-screen keyboard is a PITA, but you only really have to use it to set up the WiFi password (if applicable), and Home Sharing login/password, and after that you can use the iOS Remote app for any keyboard duties.

The big question on everyone's mind is 1080p content, so let me address that straight away. Yes, you can play a 1080p m4v file (my test file was converted in Handbrake as High Profile, RF21), but it will drop frames. In the case of my test file I guess I could say it dropped few enough so as to impress me, but it would still be unwatchable for me. Most importantly, though, the aTV is definitely downscaling it to 720p (my TV reports a 720p signal), so what's the point?

I will add that I'm testing this over 802.11n (5GHz connecting to the latest revision AirPort Extreme), so dropped frames *could* be due to that. I also tested out a 720p m4v file of the same movie (RF16, no filters), and it also appeared to have a glitch here or there which concerns me much more. I'm going to test out my RF19 720p file, as well as test out all three over wired ethernet.

FWIW, I'd say that Netflix played back with equal PQ as it does on my TiVo HD (which is better PQ than I was able to get on the WDTV Live and via Silverlight on my Acer Revo Atom/NVIDIA ION nettop. FWIW, I found that the Seagate Theater+ offers good Netflix PQ as well). Now, even at its best, I find much of the Netflix content's PQ to be pretty bad. The movie "Who's Harry Crumb" is listed as HD on Netflix's site (Note: the Netflix UI within the aTV does not appear to indicate whether a movie is HD or not) but has horrible macroblocking in the black background during the intro. The movie CGI animaged movie "Area 51" looks much better, though Netflix doesn't indicate if this is HD.

I was disappointed when I attempted to stream the Avatar movie trailer. It took about 25 secs to start playing (it's a 3 min 29 sec trailer). Once it started it looked great (720p I imagine) but it reached the end of the buffer halfway through and needed to rebuffer for a short while again. My downstream internet should be about 15Mbps, so this surprised me. I just tried another trailer (The Green Hornet) and it took about the 25-30 secs to buffer before it would start, but it never paused (in order to catch up on the buffer) after that. That's a 2 min 28 sec trailer, to give you an idea. I'm guessing the Avatar trailer is a higher bitrate. I'll also try streaming these trailers later over wired ethernet to see if that makes a difference.

The UI is overall a joy to use, but I'm not a fan of the tiled movie UI. Thank goodness it only uses this view for the movies and shows they're trying to sell you, and your own library of movies displays in a title list format (which you can filter by genre).
mduell
Veteran User
Posts: 7374
Joined: Sat Apr 21, 2007 8:54 pm

Re: Apple TV 2

Post by mduell »

Berylium wrote:As for 720p content, the last transcode I ran was the following: HandBrake High Profile, 720p loose, RF 18, and the following x264 options: b-adapt=2:rc-lookahead=50:me=umh:subq=10:trellis=2:aq-strength=1.1:psy-rd=1.2,0.10:ref=4:bframes=4

This plays smooth as silk in all my test videos. I’m trying to think what more I would do to improve it. More B-Frames? More Reference Frames? I don’t believe lowering the RF below 18 is worthwhile but I’m open to suggestions.
Look at x264cli veryslow for guidance: --b-adapt 2 --bframes 8 --direct auto --me umh --merange 24 --partitions all --ref 16 --subme 10 --trellis 2 --rc-lookahead 60

Will have to limit refs to whatever the tv actually supports.
Terc
Posts: 40
Joined: Wed May 28, 2008 6:15 am

Re: Apple TV 2

Post by Terc »

Rodeo wrote:
Terc wrote:Here's the preset download link http://cl.ly/1eddcc79a70ace5dbfe9
So your advanced options are:

Code: Select all

ref=5:me=umh:b-adapt=2:weightp=0:direct=auto:no-fast-pskip=1:no-dct-decimate=1:merange=32:bframes=5:b-pyramid=1
All the devices you target (iPhone 4, iPod touch 4G, iPad, AppleTV 2) support weightp, so no need to disable it.

In 0.9.4, b-pyramid is disabled by default and remains disabled regardless of whether you actually enable it, unless you disable mbtree (the x264 build shipping with 0.9.4 doesn't support mbtree+b-pyramid). But mbtree is a lost more useful than b-pyramid, so there's no good reason to use b-pyramid in 0.9.4. In the nightly builds, b-pyramid is compatible with mbtree and is enabled by default.

merange 32 is a bit overkill (x264 presets veryslow and placebo only use 24). There are other things you could enable that would be more useful (higher subme, raise it to 8 or 9 - or 10 if you enable trellis 2 but that's very slow). You could also enable all partitions (analyse all).

no-fast-pskip is only enabled in x264 preset placebo. Its usefulness is very low compared to the speed hit.
Thanks for the info about b-pyramid. I thought I was on an older nightly, I guess not new enough if it's storing b-pyramid=1 when it's now a default. Regarding merange=32, I found that the opening scene in The Green Mile where the farmers are running through the field with tall grass in the foreground and background with running farmers kept nearly centered in the camera required merange higher than 24 to avoid artifacts. I've stuck to 32 since, although you're right, it's probably overkill in almost every other scene in any movie.

I'll try out subme 9.

I also did not realize trellis=2 was available. Last I heard (which was a while ago), trellis=2 did nothing. Only trellis=1 was available. I don't doubt it works now, but when did this change? Trellis seems to do its job for me at 1, but I suppose I could try out trellis=2 and see if I notice a difference.

no-fast-pskip barely makes a difference for me. I've done lots of overlays and split videos and can hardly make it out. But in certain scenes, I do notice a slight difference. My encoding settings place encoding time as an absolute last priority. I only choose not to do something if there's no possible noticeable improvement. The one scene that comes to mind is the dark underwater scene at the beginning of The Bourne Identity. No-fast-pskip seemed to reduce blocking, but I haven't tested this again for quite some time. I suppose it's possible that updates have improved the blocking and no-fast-pskip no longer improves the scene.
Post Reply