High Profile Preset - x264 options

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
MonkeyBites
Posts: 11
Joined: Sat Nov 29, 2008 7:23 pm

High Profile Preset - x264 options

Post by MonkeyBites » Sun Dec 06, 2009 5:21 pm

Hi,

the High Profile is supposed to have "all the bells and whistles" of the H.264 codec, but some of the parameters which enhance the output quality (at least according to their descriptions) are disabled:

- Pyramidal B-Frames
- Motion Estimation Method: Uneven Multi-Hexagon (uses Hexagon instead)
- No Fast-P-Skip

I turned them on, and the bitrate was slightly increased for the default High Profile qualite setting (60.78%) - although the effect of both umh (as opposed hexagon) and pyramidal b-frames is described as "lowering bitrate/increasing quality". The quality was indeed slightly better.

I also changed some of the values used:

- Reference Frames: 6
- B-Frames: 6
- Subpixel Motion Estimation: 9 (instead of 7)
- Motion Estimation Range: 64 (instead of 16)

Are there any specific reasons why these settings are not used for the High Profile preset, i.e. do they have side effects (apart from encoding speed, which is mostly irrelevant for me)? I am aware the pyramidal b-frames are not supported by older versions of QuickTime, but I use QuickTime X.

Kind regards
Jan

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: High Profile Preset - x264 options

Post by jbrjake » Sun Dec 06, 2009 5:43 pm

MonkeyBites wrote:the High Profile is supposed to have "all the bells and whistles" of the H.264 codec, but some of the parameters which enhance the output quality (at least according to their descriptions) are disabled:

- Pyramidal B-Frames
- Motion Estimation Method: Uneven Multi-Hexagon (uses Hexagon instead)
- No Fast-P-Skip
Why would you want to turn off mbtree to use b-pyramid?

UMH is not worth its speed hit most of the time.

No-fast-pskip only makes sense if you have all the psychoviz stuff disabled. Which the HP preset does not.

You can go right ahead and throw on slower settings. But if I'd made the preset that slow, users would never stop complaining. 6 b-frames is kind of overkill unless you're doing animation anyway, with b-adapt 2 enabled. Using a merange of 64 is ridiculous unless you're doing very high rez encoding.

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

Re: High Profile Preset - x264 options

Post by Rodeo » Sun Dec 06, 2009 5:52 pm

MonkeyBites wrote:Are there any specific reasons why these settings are not used for the High Profile preset, i.e. do they have side effects (apart from encoding speed, which is mostly irrelevant for me)? I am aware the pyramidal b-frames are not supported by older versions of QuickTime, but I use QuickTime X.
The new High Profile preset is closer to the x264 defaults.

Regarding the 3 options you mentioned:

b-pyramid is incompatible with mbtree, and mbtree is more useful than b-pyramid, so b-pyramid is out.

no-fast-pskip improves quality but isn't worth the speed cost (there are more useful options if you want to improve quality), unless you've turned off psychovisual enhancements as jbrjake pointed out.

umh motion estimation is slow. According to x264 developer Dark_Shikari, umh isn't worth the speed cost unless you're using at least subme 8. Since the preset now uses sumbe 7, we reverted to hex motion estimation.

You may find this useful:

http://mewiki.project357.com/wiki/X264_Settings#preset

MonkeyBites
Posts: 11
Joined: Sat Nov 29, 2008 7:23 pm

Re: High Profile Preset - x264 options

Post by MonkeyBites » Sun Dec 06, 2009 5:57 pm

Many thanks – I should have known that the profile settings were not chosen for no reason.

I'll stick with the default High Profile settings then.

Thanks again,
Jan

tlindgren
Bright Spark User
Posts: 238
Joined: Sun May 03, 2009 2:14 pm

Re: High Profile Preset - x264 options

Post by tlindgren » Sun Dec 06, 2009 9:10 pm

MonkeyBites wrote:Many thanks – I should have known that the profile settings were not chosen for no reason.
I'll stick with the default High Profile settings then.
FYI, I was playing with these settings earlier and compared the High Profile profile with one based on it but with subme 9 + umh. I encoded a few movies and on average it slowed down the encodes by roughly 20% and resulted in output files that was 0.5-2.0% smaller. This was with constant quality encode, RF=20 and very similar SSIM (the best quality indicator).

This was with decomb/detelecine enabled but not triggering (so very little slowdown), no other filters. If decomb found more to do or additional filters had been enabled (denoise for example) the speed difference would obviously have been smaller but the choice the Handbrake developers made here seems pretty reasonable for most people, 20% is significant.

OTOH, if you plan to use mcdeint and/or EEDI2 you may as well run it with subme 9 and umbh because it'll be nearly or completely free given how much slower than the video encoder they are (they need to be done in SSE assembler instead of C to be more generally useful).

Gryphen
Posts: 1
Joined: Wed Jun 16, 2010 6:08 pm

Re: High Profile Preset - x264 options

Post by Gryphen » Wed Jun 16, 2010 6:38 pm

Why is aac the first and ac3 the second audio track. wouldn't make more sense for ac3 to be first so when you use vlc it uses ac3 by default?

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

Re: High Profile Preset - x264 options

Post by Rodeo » Wed Jun 16, 2010 8:17 pm

Gryphen wrote:Why is aac the first and ac3 the second audio track. wouldn't make more sense for ac3 to be first so when you use vlc it uses ac3 by default?
Apple devices prefer AAC first (or at least used to in the past), so presets with AC3 passthrough have always been done this way. Nothing prevents you from creating your own custom preset based on the High Profile preset.

creamyhorror
Regular User
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: High Profile Preset - x264 options

Post by creamyhorror » Fri Jun 18, 2010 6:39 pm

Rodeo wrote:Apple devices prefer AAC first (or at least used to in the past), so presets with AC3 passthrough have always been done this way. Nothing prevents you from creating your own custom preset based on the High Profile preset.
Eh...but on any other device I gather the user would prefer to have the original, higher-quality track played by default. The choice seems a bit counterintuitive, unless Apple devices are deemed the primary playback target even on the non-Mac versions.
jbrjake wrote:6 b-frames is kind of overkill unless you're doing animation anyway, with b-adapt 2 enabled.
A bit late, but quite a few movies will easily use 6 b-frames if allowed to under b-adapt=2. Under b-adapt=2 x264 actually seems to use more bframes than under b-adapt=1. I do think that 5 is an appropriate number if speed is prioritised a bit more.

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: High Profile Preset - x264 options

Post by jbrjake » Sat Jun 19, 2010 4:01 pm

creamyhorror wrote:Eh...but on any other device I gather the user would prefer to have the original, higher-quality track played by default. The choice seems a bit counterintuitive, unless Apple devices are deemed the primary playback target even on the non-Mac versions.
There is nothing counter-intuitive about having a much more widely supported and easier to decode track as the default. AC3 in MP4 has only been part of the spec for a couple years and is *not* widely supported. The world does not begin and end with VLC.
creamyhorror wrote:
jbrjake wrote:6 b-frames is kind of overkill unless you're doing animation anyway, with b-adapt 2 enabled.
A bit late, but quite a few movies will easily use 6 b-frames if allowed to under b-adapt=2. Under b-adapt=2 x264 actually seems to use more bframes than under b-adapt=1. I do think that 5 is an appropriate number if speed is prioritised a bit more.
Huh? One of the initial appeals of the new b-adapt mode was that it allowed better quality and compression using fewer b-frames than the old method. I'm saying 6 is kind of overkill for stuff other than animation since even x264's cli only uses 3 by default and 5 for animation. When D_S announced the new mode he told us "So, this is a warning to all those who use --bframes 16, MeGUI and otherwise; the new B-frame decision is coming soon, and when it does, in the interests of speed you may want to lower the --bframes value to 3-5 or something otherwise reasonable." In the same thread he said "That's because more than 4 is almost never useful ."

creamyhorror
Regular User
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: High Profile Preset - x264 options

Post by creamyhorror » Sat Jun 19, 2010 8:05 pm

jbrjake wrote:
creamyhorror wrote:Eh...but on any other device I gather the user would prefer to have the original, higher-quality track played by default. The choice seems a bit counterintuitive, unless Apple devices are deemed the primary playback target even on the non-Mac versions.
There is nothing counter-intuitive about having a much more widely supported and easier to decode track as the default. AC3 in MP4 has only been part of the spec for a couple years and is *not* widely supported.
I was thinking of MKV when I wrote that, sorry. I can see why it makes sense to put AAC as the first track in MP4s, but for MKVs it certainly doesn't make sense to.
The world does not begin and end with VLC.
This seems to imply it's largely only VLC that will play AC3 in MP4, but most proper software players should be able to (at least on Win/Linux). Hardware capabilities of course vary widely.
creamyhorror wrote:I'm saying 6 is kind of overkill for stuff other than animation since even x264's cli only uses 3 by default and 5 for animation. When D_S announced the new mode he told us "So, this is a warning to all those who use --bframes 16, MeGUI and otherwise; the new B-frame decision is coming soon, and when it does, in the interests of speed you may want to lower the --bframes value to 3-5 or something otherwise reasonable." In the same thread he said "That's because more than 4 is almost never useful ."
Yeah, but in practice Doom9ers have commented since then that b-adapt=2 seems to use more b-frames than b-adapt=1 did. I've noticed it myself; on live-action, you often get 5 or 6 used more a few percent or more, while b-adapt=1 has given me pretty few b-frames on a few sources I've tried.

Using more b-frames definitely deprioritizes speed, no arguing against that. But I'd say using 5-6 b-frames isn't overkill if you're looking for higher efficiency.

thompson
Bright Spark User
Posts: 356
Joined: Sat Dec 12, 2009 8:04 pm

Re: High Profile Preset - x264 options

Post by thompson » Mon Jun 21, 2010 5:12 am

creamyhorror wrote: I was thinking of MKV when I wrote that, sorry. I can see why it makes sense to put AAC as the first track in MP4s, but for MKVs it certainly doesn't make sense to.
Which is why the preset uses MP4. You can't change stuff around from the preset and then complain that other options in the preset don't make sense with your custom settings. Shesh.

Post Reply