Better Quicksync defaults

Archive of historical feature requests.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
xooyoozoo
Posts: 6
Joined: Thu Mar 28, 2013 2:09 am

Better Quicksync defaults

Post by xooyoozoo » Fri Aug 22, 2014 12:45 am

While looking through the default settings, I noticed a couple of things that seemed odd in terms of AVC as a codec, not just Quicksync itself.

Keyint: MSDK defaults this to 1 sec. Meanwhile, both x264 and x265 defaults keyint to 10s. Even Youtube only forces an I frame every 5 seconds nowadays. Unless the Handbrake team believes that QS is targeting a dramatically different use case, I think the default key interval should match x264/x265's.

B-frames & B-pyramid: The archetypal AVC frame cadence is IbBbP. Handbrake only uses this with CQP, which itself is only set as default on older CPUs. Otherwise, `constant quality` is the default mode, and Handbrake switches to mpeg2-esque IbbP. Unless something is seriously wrong with ICQ+LA in Quicksync, this looks like a large handicap.

To make sure I'm not making a big deal out of nothing, I did some cursory tests on a ~3 minute clip (2nd chapter of Contagion Bluray). Everything was done using Handbrake 6306svn with no audio and `--quality 24` on a Haswell Pentium G3258. Y-PSNR is used to determine RD ability and roughly estimate perceptual impact. It was calculated through ffmpeg-2.3.3*.

Code: Select all

	                      kbps	   FPS	  Y-PSNR
Default 	              3783.84	57.69	39.89
Key120	                3408.05	53.22	39.83
Key240	                3356.54	52.25	39.82
Key240_ibbbp_pyr1	     3229.78	56.82	39.85
Key240_ibbbp_pyr1_ref4	3132.50	47.30	39.85     (was curious)
As you can see, in this instance, keyint=240:gop-ref-dist=4:b-pyramid=1 made the encode 15% more efficient with basically no effect on encoding speed.

I don't claim that the numbers above are representative of everything under the sun, but I think they show that Intel's MSDK's defaults for Quicksync aren't necessarily optimal for the average Handbrake user. If nothing else, the settings should be reexamined.

*Encoded outputs had an extra frame added at beginning. I manually accounted for this.

WARRZONE
Posts: 21
Joined: Wed Jul 23, 2014 1:54 am

Re: Better Quicksync defaults

Post by WARRZONE » Tue Aug 26, 2014 10:19 am

You say the Youtube keyframe rate is 5, however, Youtube recommends the keyframe rate be 2 or lower. iTunes is 3-10 (depending on video). Blu-ray discs have a GOP of 12 (keyframe rate of .5). 10 is too long. If the options are between 10 and 1, I'll pick 1 for accurate scrubbing, but between 2 and 4 (usually use 2) is my preference, since I use HandBrake to create streamable M4Vs.

I think the efficiency comes from the use of B-frames. It looks like you have a GOP of 4 in that test, which should perform alright. Maybe the reason it's not default is because baseline H.264 cannot have B-frames. I wasn't aware of any advanced options in QuickSync with HandBrake, so thanks for bringing this to my attention.

User avatar
s55
HandBrake Team
Posts: 9613
Joined: Sun Dec 24, 2006 1:05 pm

Re: Better Quicksync defaults

Post by s55 » Tue Aug 26, 2014 10:58 am

@Warrzone -> https://trac.handbrake.fr/wiki/QuickSyncOptions (not sure it's 100% up to date, but there are a few nobs you can turn. Not nearly as many as x264 though)

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

Re: Better Quicksync defaults

Post by Rodeo » Tue Aug 26, 2014 3:40 pm

Note that the current settings were recommended by Intel. Since none of the developers have done any extensive testing/optimization of QSV settings, I just went with those. User "gmb" and a few others have posted recommendations elsewhere on the forum if you don't want to go with the defaults.

gmb
Bright Spark User
Posts: 332
Joined: Thu Mar 28, 2013 12:49 pm

Re: Better Quicksync defaults

Post by gmb » Sat Aug 30, 2014 3:57 pm

My favoured (quality oriented) settings in Handbrake on my Haswell looks like this

lookahead=1:gop-ref-dist=0:gop-pic-size=0:target-usage=4:lookahead-depth=40:num-ref-frame=0


And importantly Constant quality bitrate mode. It's much better than VBR on Haswell. I also use High H264 profile in Handbrake. With this settings the quality is pretty good (better than x264 preset very fast in basically every video I have tried) and very fast. Very useful for longer videos. It's so much faster than x264.

Post Reply