2 Pass with new Apple TV preset?

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.
thetalkingmonkey
Posts: 1
Joined: Sun Apr 22, 2007 11:20 pm

2 Pass with new Apple TV preset?

Post by thetalkingmonkey »

Sorry if this has already been answered but I noticed that if I choose the Apple TV preset in the new Handbrake that it does not automatically check the 2 pass option. Will I get a better quality encode by choosing this? and also, is the Apple TV preset the very best quality rip that the Apple TV will accept or can I get even better quality by raising the bitrate. The default is 2500 so is anything above that a waste of time? Thanks.
jonathankit
Posts: 8
Joined: Tue Mar 27, 2007 1:42 am

Post by jonathankit »

I think I have some possible answers for you.
First, I don't think you get better quality with two-pass but you get a smaller file size (so then technically you could increase the bit rate on a two-pass).
Second, it is not the best that Apple TV can accept. According to Apple the highest bit rate is 5000kbps, but i think people have been able to get up to 6000. I think that the preset in HB is just as a guide for what is acceptable to most people. If you can notice any difference go higher in bit rate. What is often suggested is to rip the same scene at several bit rates and see when you can no longer notice a difference, then go with that. Some people like 1500, some aren't satisfied with 7000.. it's all up to what you notice.
mike693
Posts: 46
Joined: Wed Feb 14, 2007 5:42 am

Post by mike693 »

jonathankit wrote:...I don't think you get better quality with two-pass but you get a smaller file size...
Two-pass will increase the quality, and have no meaningful impact on file size.

The first pass generates statistics about the video, which are used by the second pass. The quality is improved because the encoder can make decisions based on upcoming frames, in addition to those already encoded.
jonathankit
Posts: 8
Joined: Tue Mar 27, 2007 1:42 am

Post by jonathankit »

Oh ok, I had it backwards then. I thought two-pass didn't affect quality but decreased fiel size. Sorry about that.
NullMind
Posts: 15
Joined: Thu Apr 19, 2007 11:42 pm

Post by NullMind »

I personally have settled for these settings

AppleTV preset + 2nd pass for Animation (3d) and movies I LOVE and will see at least a few times a year (not many)

AppleTV preset @ 2000 bitrate (no 2nd pass) for most all other movies that I want on my library, but will not be standing by the TV with a magnifier to look for artifacts.
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

The AppleTV preset built into HB is designed to be a compromise between quality, rip speed and file size.

We took into account that it needed to be at a low enough bitrate to stream fairly well due to the AppleTV's rather limited hard drive. You should be aware that by changing bitrate or adding 2 pass, your are effectively changing to a custom setting, which is fine, but removes the built in HB-AppleTV presets x264 advanced option string. which both improves video quality as well as reduces file size.

So, what you might want to try is, lets say you want the AppleTV Preset but 2 pass.

1. Click on the HB-AppleTV Preset
2. Click on 2-pass
3. Click the "+" button in the presets drawer
4. Name the preset
5. check use picture settings in this preset
6. in the x264 advanced option string text field paste this line:

Code: Select all

bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:no-dct-decimate=1:trellis=2
7. Click Save.

You now have created shiny new duplicate of the HB-AppleTV Preset but using 2 pass.

Of course, you can just click on the AppleTV Preset from HB then click on 2 pass, but you will not be taking advantage of the options that are turned on using that string. You can try both and be the judge.
Fritzjung
Posts: 11
Joined: Sun Apr 22, 2007 12:32 pm

Post by Fritzjung »

dynaflash wrote:The AppleTV preset built into HB is designed to be a compromise between quality, rip speed and file size.

We took into account that it needed to be at a low enough bitrate to stream fairly well due to the AppleTV's rather limited hard drive. You should be aware that by changing bitrate or adding 2 pass, your are effectively changing to a custom setting, which is fine, but removes the built in HB-AppleTV presets x264 advanced option string. which both improves video quality as well as reduces file size.

So, what you might want to try is, lets say you want the AppleTV Preset but 2 pass.

1. Click on the HB-AppleTV Preset
2. Click on 2-pass
3. Click the "+" button in the presets drawer
4. Name the preset
5. check use picture settings in this preset
6. in the x264 advanced option string text field paste this line:

Code: Select all

bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:no-dct-decimate=1:trellis=2
7. Click Save.

You now have created shiny new duplicate of the HB-AppleTV Preset but using 2 pass.

Of course, you can just click on the AppleTV Preset from HB then click on 2 pass, but you will not be taking advantage of the options that are turned on using that string. You can try both and be the judge.
Gospel (to me) - thanks for this answer - I'll make this preset tonight.

Question - If I wanted to render better quality - with little regard to file size - FROM your apple TV preset - would adding 2 pass be my best/first choice ? - after that uping the br beyond 3k -

Ideally I'd like the best quality I can get whilst still keeping it useable in apple tv.

thanks again for this program.

Fritz
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

Fritzjung wrote:Question - If I wanted to render better quality - with little regard to file size - FROM your apple TV preset - would adding 2 pass be my best/first choice ? - after that uping the br beyond 3k -

Ideally I'd like the best quality I can get whilst still keeping it useable in apple tv.
Well, I hate to say that is mostly a matter of opinion. 2 pass will help some, although, there is some argument as to whether or not its worth twice the encoding time.

Upping the bitrate to 3000 will definitely help for some movies, but here again, its subjective, try some tests with the same movie and you be the judge.

Also, with the appleTV we need to take into account streaming capability. In my case, I want to maintain the ability for the appleTV to be able to stream my videos smoothly. This is why we dropped the bitrate for the HB-AppleTV preset from 3000 to 2500 right before release. That, and for most movies, we did not see a big difference (in many cases none at all) between the two bitrates.

One note: this all hinges on using that advanced 264 option string (in my above post) with your preset. Without it, the difference between 2500 and 3000 becomes more apparent.

Ultimately you are the best judge for your setup. One bitrate may look great on a 37" LCD but not so much on a 50" LCD. So, take your own situation into account.

One other thing to be aware of. Currently HB has an issue if the final movie size is over 4 GB (although, a fix is on its way), so if you up the bitrate too much, you may run into that wall if the movie is long enough.

Good Luck, and let us know what you like.
Fritzjung
Posts: 11
Joined: Sun Apr 22, 2007 12:32 pm

Post by Fritzjung »

clipped but fully consumed....

>One note: this all hinges on using that advanced 264 option string (in my
>above post) with your preset. Without it, the difference between 2500
>and 3000 becomes more apparent.

GREAT response - thanks - I did tweak up a new present from your wisdom and the 264 option string -

thanks for giving me more to consider
test test test - will I

Fritz
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

I am glad to see that you are using the Built-In presets as a starting point for developing your own custom presets. That was the hope when we added them.

Testing can be a pain, but its the only true way to get HB to do exactly what you want. Customizing it for your personal taste. Good stuff.
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

I am making this one a sticky, as it may be helpful to others.
Fritzjung
Posts: 11
Joined: Sun Apr 22, 2007 12:32 pm

Post by Fritzjung »

dynaflash wrote:I am glad to see that you are using the Built-In presets as a starting point for developing your own custom presets. That was the hope when we added them.

Testing can be a pain, but its the only true way to get HB to do exactly what you want. Customizing it for your personal taste. Good stuff.
Testing is the least us 'users' can do - Thanks so much - You guys rule !!!

Fritz
metroxing
Posts: 1
Joined: Thu Apr 26, 2007 8:41 am

My Testing

Post by metroxing »

I don't have an AppleTv so I cannot speak for its requirements or that new preset but I can tell you for me, 2-pass seems to create a better final file at a much smaller size for mac & ipod playback.

I ripped a 2 1/2-minute scene at the AppleTV settings and got a 58MB file size. At my normal settings H.264, 2-pass, 1,300 and de-interlace, I got a 30 MB file. And my settings produced a slightly sharper file - not by much but along with a nearly 50% reduction in file size, for me, 1,300 & 2 pass just seems a better choice - yes, it takes twice as long but I'm willing to get the best balance of file size and resolution with one rip (not going to redo it later on).

My long review- really more intended for newbies ...

http://2aday.wordpress.com/2007/04/25/m ... idescreen/
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Re: My Testing

Post by dynaflash »

metroxing wrote:I don't have an AppleTv so I cannot speak for its requirements or that new preset but I can tell you for me, 2-pass seems to create a better final file at a much smaller size for mac & ipod playback.

I ripped a 2 1/2-minute scene at the AppleTV settings and got a 58MB file size. At my normal settings H.264, 2-pass, 1,300 and de-interlace, I got a 30 MB file. And my settings produced a slightly sharper file - not by much but along with a nearly 50% reduction in file size, for me, 1,300 & 2 pass just seems a better choice - yes, it takes twice as long but I'm willing to get the best balance of file size and resolution with one rip (not going to redo it later on).

My long review- really more intended for newbies ...

http://2aday.wordpress.com/2007/04/25/m ... idescreen/
metroxing, is that your review? most of us devs read it yesterday (I think jbrjake and clee, both responded to it) and thank you for the nice review.

One thing I dont want to confuse anyone about though, 2- pass with everything else staying the same, will not reduce your files size by anything meaningful, but will increase the quality some. If you are getting a significantly reduced file size, you must be changing some other settings like the bitrate being cut in half in your example above.

As always differences in quality will vary from dvd to dvd. Fast motion vs. slow, light vs. dark, etc. etc.

It is important to note that the AppleTV preset built into HandBrake is designed for a video that is to be shown on tv's as high as 50 + inches. So, your 1300 kbps bitrate video would likely show alot of pixelation and blockiness in that scenario.

Again, thank you for your review, it was a very good read.
jasonnorm
Posts: 5
Joined: Thu Apr 26, 2007 2:44 pm

Streaming file size concern

Post by jasonnorm »

Guys,

This is an excellant post and thanks for making it sticky :)

My question is that from what I am told (and from my own experience), iTunes will not stream a file that is greater then 4 GB on a 32 bit system. So, this means that I want the best quality I can while mantaining a file size < 4GB. If I use the flags posted that are for "optimal" quality and force teh resulting file size to ~ 4 GB, will this negate the quality options?

(The string I am refering to is: bframes=6:ref=3:b-rdo=1:direct=auto:subme=6:trellis=1:analyse=p8x8,b8x8,i4x4,p4x4:me=umh:no-dct-decimate=1:bime=1:weightb=1:mixed-refs=1:no-fast-pskip=1)

The key is to keep the file size under 4 GB.

Any help would be appreciated!

Thanks!
jason
e71
Posts: 15
Joined: Thu Mar 29, 2007 7:14 pm

Problem with presets

Post by e71 »

I've found a problem using a customized preset instead of the built-in HB-AppleTV preset. When following the instructions above for creating a customized preset for Apple TV, the new preset ends up inheriting the width, height and crop sizes from the current DVD. As a result, when the preset is applied, the width, height and crop values are set based on the settings at the time the preset was created. The resulting video file will likely not have the desired width and height or cropping. I originally noticed this as my videos had black bars in them where they were not supposed to.

I've had a look at the code and the built-in AppleTV preset uses a setting designed to allow it to use the max picture size from the DVD at the time the preset was applied instead of the one when the preset was created. Unfortunately there's no UI to enable that setting for any custom presets. I have found 2 possible workarounds that should get around this problem until the root cause is fixed.
  1. Modify the plist containing the presets so that your custom preset has the same "UsesMaxPictureSettings" attribute that the built-in AppleTV preset does.
    • To do this, first quit Handbrake. Then edit the ~Library/Application Support/HandBrake/UserPresets.plist file using either Property List Editor application that comes with the Developer tools, or with your favorite text editor. Its probably best to make a copy of this file before editing it in case something goes wrong. There is a dictionary for each preset (with <dict> and </dict> lines at the start and end of each. Find the dictionary representing your custom preset by searching for the key "PresetName" and comparing the string in the following line to the name of your preset. Once you find that dictionary, find the key "UsesMaxPictureSettings" in the same dictionary. It will likely only be a few lines after "PresetName". Change the line after "<key>UsesMaxPictureSettings</key>" as follows:

      From:

      Code: Select all

      <key>UsesMaxPictureSettings</key>
      <integer>0</integer>
      To:

      Code: Select all

      <key>UsesMaxPictureSettings</key>
      <integer>1</integer>
    • Then save the file and launch Handbrake. The new settings should now be used.
  2. Instead of editing the raw preset, you can just click on the "Picture Settings" button each time after applying the custom preset. Then click the "Close" button on the picture window. That should allow the actual picture settings to be applied. In my tests, this appears to produce the correct anamorphic output picture size, although somebody that knows the code better should probably verify that this really does what we want.
Unfortunatly if you have been using a modified HB-AppleTV preset as described above, your videos probably have incorrect sizes and cropping unless you've been going into the Picture Settings panel each time. You probably will want to check the width, height and cropping of the video files and re-encode if necessary.
deckeda
Enlightened
Posts: 138
Joined: Thu Feb 22, 2007 8:38 am

Re: Problem with presets

Post by deckeda »

I'll try this tomorrow. I thought I'd gone crazy these last 2 days. Thanks esb. I wouldn't have occurred to me that a preset would influence cropping.

Here's the thread I almost started, but had decided to wait until I could play around some more:
"Anamorphic output" size didn't equal actual resulting size ...

I encoded The Departed yesterday with 0.85b1. HB reported Output would be 720x358 and Anamorphic Output would be 853x358.

The finished file is actually 853x480, so it's got black bars top and bottom --- the image itself is 853x358.

I encoded the same movie last week with *I think* the last SVN prior to the general 0.85b1 release and the file was 853x358 total as expected, no black bars.

I never touched cropping for either.
^^ The real difference between the two encodes if my memory is correct is a custom preset based on HB-AppleTV was used on the latter. Will definitely be looking at this tomorrow.
esb wrote:[*]Instead of editing the raw preset, you can just click on the "Picture Settings" button each time after applying the custom preset. Then click the "Close" button on the picture window. That should allow the actual picture settings to be applied. ...
I don't *think* that worked for me; I'm pretty sure I clicked on the "Picture Settings" button for at least one I did yesterday and it still came out with black bars. But something else really bizarre happened --- I'm not even gonna post about it unless I can re-create it.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: Problem with presets

Post by jbrjake »

esb wrote:I've had a look at the code and the built-in AppleTV preset uses a setting designed to allow it to use the max picture size from the DVD at the time the preset was applied instead of the one when the preset was created. Unfortunately there's no UI to enable that setting for any custom presets.
Err...I'd swear there's an "Apply current picture settings to this preset" checkbox on the sheet where you add a new preset.
e71
Posts: 15
Joined: Thu Mar 29, 2007 7:14 pm

Re: Problem with presets

Post by e71 »

jbrjake wrote:
esb wrote:I've had a look at the code and the built-in AppleTV preset uses a setting designed to allow it to use the max picture size from the DVD at the time the preset was applied instead of the one when the preset was created. Unfortunately there's no UI to enable that setting for any custom presets.
Err...I'd swear there's an "Apply current picture settings to this preset" checkbox on the sheet where you add a new preset.
That's what causes the problem. That checkbox causes the current DVD's width, height and crop settings to get stored in the preset which then are directly applied when the preset is used. Unfortunately you need that checkbox to preserve the "Anamorphic (PAR)" setting.
e71
Posts: 15
Joined: Thu Mar 29, 2007 7:14 pm

Re: Problem with presets

Post by e71 »

deckeda wrote:
esb wrote:[*]Instead of editing the raw preset, you can just click on the "Picture Settings" button each time after applying the custom preset. Then click the "Close" button on the picture window. That should allow the actual picture settings to be applied. ...
I don't *think* that worked for me; I'm pretty sure I clicked on the "Picture Settings" button for at least one I did yesterday and it still came out with black bars. But something else really bizarre happened --- I'm not even gonna post about it unless I can re-create it.
After looking into this a little more, I think you're right that this won't work. It looks like the width could be messed up and the crop settings aren't restored until after they're used to determine the height.

So it looks like #2 above isn't a complete solution either.
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

He is right. My apologies, using "current picture settings" will apply your current setttings (at the time of preset creation) to every movie.

The AppleTV preset uses a " Use Max width and height" property that you cannot currently create in your own presets. I am writing a change to the new preset panel to incorporate that as we speak. It will be available in the next release.

Again, my apologies.

Joe
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

Okay, so this might be a decent workaround until our next release:

1. in your prefs, check the box to always set to anamorphic on launch.
2. Click on the HB-AppleTV Preset
3. Click on "2 Pass"
4. Click "+" in the preset drawer
5. Name your preset
6. Do NOT click the use picture settings in preset checkbox
7. add the magic sauce in advanced x264 options field:

Code: Select all

bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:no-dct-decimate=1:trellis=2
8. Save preset

Now every time you scan a dvd, the anamorphic max size of the dvd is set (as per your preferences). Click on your new preset and go, your movie will use its own max width from scan and anamorphic (as it should) and you will get all of the settings of the HB-AppleTV preset as well as 2 pass.

This should work just fine, since you likely want to use anamorphic for everything anyway unless you are encoding for iPod in which case the x264(iPod) encoder automatically shuts off anamorphic anyway.

Sorry for the workaround, but the next release will have the presets system much more refined and comprehensive. Thanks for your patience.
deckeda
Enlightened
Posts: 138
Joined: Thu Feb 22, 2007 8:38 am

Post by deckeda »

Because I was already familiar with editing prefs files I chose Method #1, which is a very easy fix if you've already made a custom preset --- and yes it works.

Thanks again to e71 for sleuthing this and to dynaflash for the upcoming fix. This is precisely how the process of improvement should work, IMO.
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

deckeda wrote:Because I was already familiar with editing prefs files I chose Method #1, which is a very easy fix if you've already made a custom preset --- and yes it works.

Thanks again to e71 for sleuthing this and to dynaflash for the upcoming fix. This is precisely how the process of improvement should work, IMO.
deckeda, great, you are right, changing that value in the .plist will work just fine as well.

I just made numerous changes to how HB handles the x264 option string in presets, among other things, HB will now retain whatever string is in a preset, allowing you to change other settings and create a new preset while maintaining that string.

Additionally, HB will be taking the string right from a new text field in the main window, so you will no longer have to specify it when you add a new preset.

Just wanted you guys to know, we are moving forward on this stuff. while maintaining compatiblity with your current presets, so when you upgrade to our next release, you do not have to recreate all of your presets.
PigFace
Posts: 1
Joined: Sat May 05, 2007 6:35 pm

Post by PigFace »

dynaflash wrote:Okay, so this might be a decent workaround until our next release:

1. in your prefs, check the box to always set to anamorphic on launch.
2. Click on the HB-AppleTV Preset
3. Click on "2 Pass"
4. Click "+" in the preset drawer
5. Name your preset
6. Do NOT click the use picture settings in preset checkbox
7. add the magic sauce in advanced x264 options field:

Code: Select all

bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:no-dct-decimate=1:trellis=2
8. Save preset

Now every time you scan a dvd, the anamorphic max size of the dvd is set (as per your preferences). Click on your new preset and go, your movie will use its own max width from scan and anamorphic (as it should) and you will get all of the settings of the HB-AppleTV preset as well as 2 pass.
With the Max size of the DVD set, is there any reason to adjust cropping?? I have issues with files over 2GB, so I have been erasing the BitRate and changing max size to 1975. Wondering if there is any need to adjust cropping or if the "secret Sauce" takes care of image size. Thanks Everyone - This product is GREAT!!!
Post Reply