*** AppleTV 3 and the New iPad (Presets) ***

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.
Tree Dude
Regular User
Posts: 128
Joined: Sun Aug 29, 2010 10:30 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Tree Dude »

Katzenfan wrote:I made some test encodings with the blu-ray movie "300" and the 3 presets Normal, High Profile and AppleTV 2.
Settings: 1920x800, Cropping 0,0,140,140, Anamorphic Strict, Large File Size enabled, Decomb&Detelecine Off.
Here are the results:

Constant Quality RF:19
- Normal: 12,2 GB (Encoding Time Hour:Min rounded - 3:45)
- High Profile: 12,7 GB (26:15)
- AppleTV 2: 13,2 GB (10:45)

Constant Quality RF:20
- Normal: 10,2 GB (6:45)
- High Profile: 10,7 GB (11:00)
- AppleTV 2: 11,1 GB (10:00)

I will do High Profile RF:19 again, because the encoding time seems very long for me.
The high profile encode time is so long because detelecine and decomb are set to default. Both of these filters are single threaded. Since your source is a BR you should not need them. I would create a new preset based on the high profile and turn them off. Your encode time should end up just slightly longer than the ATV2 preset.

User avatar
Rodeo
HandBrake Team
Posts: 12480
Joined: Tue Mar 03, 2009 8:55 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Rodeo »

Tree Dude wrote:The high profile encode time is so long because detelecine and decomb are set to default. Both of these filters are single threaded. Since your source is a BR you should not need them. I would create a new preset based on the high profile and turn them off. Your encode time should end up just slightly longer than the ATV2 preset.
No, decomb is threaded. But it can still be a bottleneck and/or slow down the encode.

Eug
Posts: 27
Joined: Tue Apr 10, 2007 2:01 am

High Profile Level 4.0 1080p H.264 on Apple TV 2

Post by Eug »

Scott R wrote:I probably won't have time to test this out for several days, but I wouldn't be surprised if High Profile 1080p will also *now* work with the ATV2 running the latest version of the OS. I already had success playing full-bitrate Blu-ray rips on the ATV2 via XBMC, but the stock OS/player stuttered. Since the recent OS upgrade, it looks like Apple improved performance of the stock player. It will still output at only 720p, but it might be able to play these High Profile 1080p files smoothly.
Yes, I too have noticed this change in behaviour, and suspect my single-core A4 Apple TV 2 can finally handle 1080p properly.

Before, most (but not all) 1080p files would stutter if I tried to play them on my ATV2 with the previous OS. I tried 900p (1600x900) encodes too with Handbrake 0.9.5 using the ATV2 preset, with custom resolution settings, but playback with those wasn't perfectly consistent either.

However, I've just Subler'd a couple of my higher bitrate 1080p MKV high profile rips (8-12 GB movies) and simply repackaged them to m4v (no transcoding) and the clips I've tried played just fine on the ATV2 with the new OS. (This is not an ideal solution for losslessly converting MKV files though, because iTunes/QT playback will crash on some of these files on a Mac.)

So, I think it would probably make sense for some of us ATV2 users to just use the High Profile preset going forward. It will take some further ongoing testing to confirm, but I suspect it will work fine on ATV2. Sure, 1080p is bigger than it needs, but if these files do work fine on ATV2, it will save having to encode multiple files to support other 1080p-capable devices.

I knew it take the release of ATV3 to achieve the holy grail of native Apple TV 1080p file playback, but colour me pleasantly surprised that it's been added to ATV2 as well.


nathug wrote:I would just like to point out, that I think its been more of a Software upgrade here. Yes the ATV3 puts out 1080p, but I have found that the ATV2 plays them just fine too.

I've encoded 10 films now on the High Profile settings using the latest Nightly Builds, and they have all run fine on my ATV2, no stuttering and buffering really well via Wi-Fi! Even Jurassic Park, which is the grainiest film I have seen in a long time, with a file size of just under 17gb! And they look amazing!

Average file size has been between 3-6gb's. Anything not shot digitally is a little more 8-16gb.
Excellent.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

m4dm0nk3y wrote:Wow, that's interesting. My ATV3 will arrive in a couple of days. I'll experiment and report in this thread.
Tested several max b-frames settings with a 1080p source.
3, 4, 5, 8, 16, they all work fine on the ATV3. Can't see any visual difference. File sizes decrease as max b-frames increase, but it's negligible.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

nehalem wrote:I've been using high profile with 21 constant quality for 720p and 22 for 1080p.

I'm surprised to see how low peoples constant quality is here. With 20 I was seeing some blu-rays get over 10 gigs which is pretty high considering I would like the option to add them to my new iPad.

I've done some comparisons with 20 vs 22 (1080p on both the descendants and dances with wolves) and I really couldn't tell there was any difference. Furthermore the wiki suggests 22 (+/- 1) for high def rips.
I totally agree with you. I've done some testing on my own with the first few minutes of Avatar with 2 sets of settings:

A/ High Profile built-in settings + --preset veryslow --tune film --ref 4 --bframes 3 --crf 20 (all video filters off)
B/ High Profile built-in settings + --preset veryslow --tune film --ref 4 --bframes 3 --crf 22 (all video filters off)

and I couldn't notice any difference on my 52" LCD. Definitely my target settings for the ATV3 for 1080p sources.

Katzenfan
Posts: 25
Joined: Fri Sep 16, 2011 8:19 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Katzenfan »

What exactly does these additional parameters?
--preset veryslow --tune film --ref 4 --bframes 3
compared with standard High Profile Preset?

When i chose High Profile Preset, in the advanced tab there are these parameters
b-adapt=2:rc-lookahead=50

So in your example, you are substituting these parameters with
--preset veryslow --tune film --ref 4 --bframes 3 --crf 22
right?

(as you can see, i am not familiar with such parameters, i have just used the options within the gui before)

Eug
Posts: 27
Joined: Tue Apr 10, 2007 2:01 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Eug »

I find I usually don't notice much difference at RF 22 vs RF 20, unless I'm pixel peeping on my 27" iMac. Nonetheless I usually encode at 20. :P For 720p I might go as low as 19, but now that my ATV2 supports 1080p, I'll just stick with 1080p whenever possible.

10 GB is big, but flash memory is fast coming down in price.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

Katzenfan wrote:What exactly does these additional parameters?
--preset veryslow --tune film --ref 4 --bframes 3
compared with standard High Profile Preset?

When i chose High Profile Preset, in the advanced tab there are these parameters
b-adapt=2:rc-lookahead=50

So in your example, you are substituting these parameters with
--preset veryslow --tune film --ref 4 --bframes 3 --crf 22
right?

(as you can see, i am not familiar with such parameters, i have just used the options within the gui before)
No, these are x264 settings when it is used as a standalone command line program.

To get the same settings in Handrake:

1/ Choose the High Profile built in preset
2/ In the "Advanced" tab, set settings as follow:
Ref frames: 4 (if the output size is 1080p) or 9 (if the output size is 720p)
Max B-Frames: 3
CABAC: On
8x8 Transform: On
Weighted P-Frames: On
Pyramidal B-Frames : Normal
No DCT decimate: Off
Adaptive B-Frames: Optimal
Adaptive Direct Mode: Auto
Motion Estimation Method: UMH
Subpixel ME & Mode Decision: 10 QPRD in all frames
Motion Estimation Range: 24
Partition Type: All
Trellis: Always
Adaptive Quantization Strength: 1
Pyschovisual Rate Distorsion: 1
Pyschovisual Trellis: 0.15
Deblocking: -1/-1
Custom string: change "rc-lookahead=50" to "rc-lookahead=60"

With these settings, the h264 encoder (i.e x264) embedded within Handbrake will take MORE time to analyze the video stream, but it will make a MUCH better use of the bits, resulting in a MUCH better visual quality. Therefore, all those bits available @ RF20 are not needed, RF22 has enough bits for most if not all 1080p movies.

Abulia
Posts: 47
Joined: Thu Feb 21, 2008 12:16 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Abulia »

m4dm0nk3y wrote: With these settings, the h264 encoder (i.e x264) embedded within Handbrake will take MORE time to analyze the video stream, but it will make a MUCH better use of the bits, resulting in a MUCH better visual quality.
No, not in my opinion. You're vastly overstating things. First, looking at your changes vs the default High Profile settings the only differences are:
Ref frames: 4 (if the output size is 1080p) or 9 (if the output size is 720p)
Adaptive Direct Mode: Auto
Motion Estimation Method: UMH
Subpixel ME & Mode Decision: 10 QPRD in all frames
Motion Estimation Range: 24
Partition Type: All
Trellis: Always
Pyschovisual Trellis: 0.15
Deblocking: -1/-1
Custom string: change "rc-lookahead=50" to "rc-lookahead=60"
Everything else is already in the High Profile setting. Some of these only effect compression/filesize and don't materially affect quality. Even then, take two encodes and run them through these settings and High Profile and I'll wager you'll probably not be able to tell the difference unless you do a pixel-by-pixel examination.

For most folks the High Profile setting is "the sweet spot" for quality vs encode time vs file size.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

Abulia wrote:
m4dm0nk3y wrote: With these settings, the h264 encoder (i.e x264) embedded within Handbrake will take MORE time to analyze the video stream, but it will make a MUCH better use of the bits, resulting in a MUCH better visual quality.
No, not in my opinion. You're vastly overstating things. First, looking at your changes vs the default High Profile settings the only differences are:
Ref frames: 4 (if the output size is 1080p) or 9 (if the output size is 720p)
Adaptive Direct Mode: Auto
Motion Estimation Method: UMH
Subpixel ME & Mode Decision: 10 QPRD in all frames
Motion Estimation Range: 24
Partition Type: All
Trellis: Always
Pyschovisual Trellis: 0.15
Deblocking: -1/-1
Custom string: change "rc-lookahead=50" to "rc-lookahead=60"
Everything else is already in the High Profile setting. Some of these only effect compression/filesize and don't materially affect quality. Even then, take two encodes and run them through these settings and High Profile and I'll wager you'll probably not be able to tell the difference unless you do a pixel-by-pixel examination.

For most folks the High Profile setting is "the sweet spot" for quality vs encode time vs file size.
The RF level and all these settings DO affect compression efficiency as well as visual quality. It's not my opinion, it's a fact from x264 developpers/gurus. Go check/chat on dedicated forums. Arguing over this fact is pointless, so no more argument on my end.

Besides, arguing over visual quality is equally pointless, because it's all a matter of perception and personal preference. If your eyes like what they see with the stock High Profile preset, then there's probably no reason for you to tweak whatever settings.

As far as my eyes are concerned, they are satisfied with what they see with High Profile + customized settings + RF22, since they can't notice any difference with RF20. And I get a smaller file size as an extra bonus.

My sweet spot isn't the same as yours. For the visual quality I choose, I tend to privilege a smaller file size at the expense of a longer encode time.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

Do any of you guys suffer from motion judder?
To what extent?
How do you deal with it?

I do see such artifacts from time to time, and it can be quite annoying. I get rid of them by:
- speeding up the movie to 25fps (no need to re-enconde video, just force the framerate in the container; still need to re-enconde audio though)
- forcing the ATV output to 50hz

I get a smoooooooooth movie on my LCD. Just perfect.

I perform the first step outside of HB for now, didn't do any test with it yet...
EDIT: It seems that HB can't speed up the movie. I'm afraid increasing the framerate will actually create extra data (interpolation)...

User avatar
Rodeo
HandBrake Team
Posts: 12480
Joined: Tue Mar 03, 2009 8:55 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Rodeo »

No interpolation, HandBrake just drops and/or duplicates frames.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

Rodeo wrote:No interpolation, HandBrake just drops and/or duplicates frames.
Thx. Any idea if speedups/slowdowns (including audio adjustments) might be implemented in the future?

User avatar
Rodeo
HandBrake Team
Posts: 12480
Joined: Tue Mar 03, 2009 8:55 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Rodeo »

The following commit:

https://trac.handbrake.fr/changeset/4546

should make this a bit easier.

But I don't think there is any developer interest in adding such functionality.

As always, patches welcome.

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

I see. Thanks.
Unfortunately, I'm not a [good] developper [anymore]. :(

nehalem
Posts: 8
Joined: Mon Mar 07, 2011 8:45 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by nehalem »

m4dm0nk3y wrote:
Katzenfan wrote:What exactly does these additional parameters?
--preset veryslow --tune film --ref 4 --bframes 3
compared with standard High Profile Preset?

When i chose High Profile Preset, in the advanced tab there are these parameters
b-adapt=2:rc-lookahead=50

So in your example, you are substituting these parameters with
--preset veryslow --tune film --ref 4 --bframes 3 --crf 22
right?

(as you can see, i am not familiar with such parameters, i have just used the options within the gui before)
No, these are x264 settings when it is used as a standalone command line program.

To get the same settings in Handrake:

1/ Choose the High Profile built in preset
2/ In the "Advanced" tab, set settings as follow:
Ref frames: 4 (if the output size is 1080p) or 9 (if the output size is 720p)
Max B-Frames: 3
CABAC: On
8x8 Transform: On
Weighted P-Frames: On
....
Ha, you weren't kidding. I decided to try this one out. My poor mac mini is doing less than 4 frames per second!

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

It's much slower indeed. But if you like the quality and can afford the encode time, you get a relatively small file compared with rf=20.
For instance, I encoded Avatar 1080p with 4 audio tracks (2xaac stereo + 2xac3 DD), the file is a little below 9gb.

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by GarrettL1979 »

Excuse my ignorance (i'm new to this), but what is the best way to keep the file size under 5GB while maintaining good quality for my ATV3? I have a slow internet connection, so a smaller file size would be helpful. Should I increase RF significantly?

Flo
Bright Spark User
Posts: 211
Joined: Thu Nov 26, 2009 5:41 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Flo »

How does your internet connection factor into this? Are you planning on taking your Apple TV on the road?

m4dm0nk3y
Posts: 24
Joined: Mon Mar 26, 2012 11:32 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by m4dm0nk3y »

GarrettL1979 wrote:Excuse my ignorance (i'm new to this), but what is the best way to keep the file size under 5GB while maintaining good quality for my ATV3? Should I increase RF significantly?
The only way to make sure videos fit under 5gb is to encode with an "Average Bitrate" (use a 2-pass encoding for improved quality) instead of a "Constant Quality". It involves calculation upfront in order to determine the actual average bitrate depending on the video framerate, length, and audio stream(s) properties. Since you are new to this, I'd recommend not to choose this path though.

One alternative is obviously the use of "Constant Quality". The downside for you is that you can't easily reach a target filesize. You'd have to test different combinations of encoding settings (including RF level and other advanced settings) for each movie. This can take some time (but will get easier with experience)...

In addition, I hear your constraint of having a filesize under 5gb. But you need to understand that for a given filesize, you will get different levels of quality for different movies since they are not equally "encodeable" (is that proper english ? :? ). For instance, you usually won't get the same level of quality for a 1.5h long movie and a 2.5h long movie.

If you can loosen the filesize constraint a little, my advice is twofold:
1/ you can afford LONG encode times: use my recommended advanced settings (earlier in this thread) and set RF at 22. If the file size is acceptable, then you're done. If not, re-encode with RF at 22.5, 23, ... I'm afraid you'll have to play trial and error for each movie...
2/ you can't afford LONG encode times: follow the exact same procedure but use the "High Profile" builtin preset instead of my advanced settings.

Hope all of this makes sense to you.
GarrettL1979 wrote:I have a slow internet connection, so a smaller file size would be helpful.
What's the connection between your slow internet connection and the target filesize :?:

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by GarrettL1979 »

m4dm0nk3y wrote:
GarrettL1979 wrote:Excuse my ignorance (i'm new to this), but what is the best way to keep the file size under 5GB while maintaining good quality for my ATV3? Should I increase RF significantly?
The only way to make sure videos fit under 5gb is to encode with an "Average Bitrate" (use a 2-pass encoding for improved quality) instead of a "Constant Quality". It involves calculation upfront in order to determine the actual average bitrate depending on the video framerate, length, and audio stream(s) properties. Since you are new to this, I'd recommend not to choose this path though.

One alternative is obviously the use of "Constant Quality". The downside for you is that you can't easily reach a target filesize. You'd have to test different combinations of encoding settings (including RF level and other advanced settings) for each movie. This can take some time (but will get easier with experience)...

In addition, I hear your constraint of having a filesize under 5gb. But you need to understand that for a given filesize, you will get different levels of quality for different movies since they are not equally "encodeable" (is that proper english ? :? ). For instance, you usually won't get the same level of quality for a 1.5h long movie and a 2.5h long movie.

If you can loosen the filesize constraint a little, my advice is twofold:
1/ you can afford LONG encode times: use my recommended advanced settings (earlier in this thread) and set RF at 22. If the file size is acceptable, then you're done. If not, re-encode with RF at 22.5, 23, ... I'm afraid you'll have to play trial and error for each movie...
2/ you can't afford LONG encode times: follow the exact same procedure but use the "High Profile" builtin preset instead of my advanced settings.

Hope all of this makes sense to you.
GarrettL1979 wrote:I have a slow internet connection, so a smaller file size would be helpful.
What's the connection between your slow internet connection and the target filesize :?:
Thanks a lot for your help! If I use the high profile preset with strict anamorphic, but up the RF to 22 will I notice a significant drop off in quality? I am okay with a long encode, so I will try your advanced settings too.

As for your question, I assumed a larger file size would take longer to buffer over my LAN-- which is tied in with my internet connection speed (currently 3mbps), no? Sounds like this is wrong :oops:

nehalem
Posts: 8
Joined: Mon Mar 07, 2011 8:45 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by nehalem »

Your lan and internet speed should be and typically are independent.

Flo
Bright Spark User
Posts: 211
Joined: Thu Nov 26, 2009 5:41 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by Flo »

GarrettL1979 wrote:As for your question, I assumed a larger file size would take longer to buffer over my LAN-- which is tied in with my internet connection speed (currently 3mbps), no? Sounds like this is wrong :oops:
Under normal circumstances, streaming traffic between your computer and your Apple TV should never leave your LAN/WLAN, so that's the limiting factor, not the speed of your internet connection.

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by GarrettL1979 »

Ah-- I stand corrected. How does one go about increasing streaming speeds over LAN?

nehalem
Posts: 8
Joined: Mon Mar 07, 2011 8:45 pm

Re: *** AppleTV 3 and the New iPad (Presets) ***

Post by nehalem »

Check your switch/hub. Is it 100 mb ethernet? If you want faster you can go to 1gb ethernet by switching out that piece of hardware. If you have 1gb hub/switch then you should be good.

Post Reply