The official documentation for x265 is very good, so this page will only cover recommended values and switches.
Source-independent settings
-
--preset verysloworslower -
--no-rectfor slower computers. There's a slight chance it'll prove useful, but it probably isn't worth it. -
--no-ampis similar torect, although it seems to be slightly more useful. -
--no-open-gop -
--no-cutreesince this seems to be a poor implementation ofmbtree. -
--no-rskiprskipis a speed up that gives up some quality, so it's worth considering with bad CPUs. -
--ctu 64 -
--min-cu-size 8 -
--rdoq-level 2 -
--max-merge 5 -
--rc-lookahead 60although it's irrelevant as long as it's larger than min-keyint -
--ref 6for good CPUs, something like4for worse ones. -
--bframes 16or whatever your final bframes log output says. -
--rd 3or4(they're currently the same). If you can endure the slowdown, you can use6, too, which allows you to test--rd-refine. -
--subme 5. You can also change this to7, but this is known to sharpen. -
--merange 57just don't go below32and you should be fine. -
--high-tier -
--range limited -
--aud -
--repeat-headers
Source-dependent settings
-
--output-depth 10for 10-bit output. -
--input-depth 10for 10-bit input. -
--colorprim 9for HDR,1for SDR. -
--colormatrix 9for HDR,1for SDR. -
--transfer 16for HDR,1for SDR. -
--hdr10for HDR. -
--hdr10-optfor 4:2:0 HDR,--no-hdr10-optfor 4:4:4 HDR and SDR. -
--dhdr10-info /path/to/metadata.jsonfor HDR10+ content with metadata extracted using hdr10plus_parser.
-
--dolby-vision-profile 8.1specified Dolby Vision profile. x265 can encode only to profiles5,8.1, and8.2 -
--dolby-vision-rpu /path/to/rpu.binfor Dolby Vision metadata extracted using dovi_tool. -
--master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,20)"for BT.2020 or
G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)for Display P3 mastering display color primaries with the values for L coming from your source's MediaInfo for mastering display luminance.For example, if your source MediaInfo reads:
Mastering display color primaries : BT.2020 Mastering display luminance : min: 0.0000 cd/m2, max: 1000 cd/m2 Maximum Content Light Level : 711 cd/m2 Maximum Frame-Average Light Level : 617 cd/m2This means you set
"G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,0)" -
--max-cll "711,617"from your source's MediaInfo for maximum content light level and maximum frame-average light level. The values here are from the above example. -
--cbqpoffsand--crqpoffsshould usually be between -3 and 0 for 4:2:0. For 4:4:4, set this to something between 3 and 6. This sets an offset between the bitrate applied to the luma and the chroma planes. -
--qcompbetween0.60and0.80. -
--aq-mode 4,3,2,1, or--hevc-aqwith4and3usually being the two best options. If using aMod, there is an extra mode5. These do the following:-
Standard adaptive quantization, simply add more bits to complex blocks.
-
Adaptive quantization with auto-variance.
-
Adaptive quantization with auto-variance and bias to dark scenes.
-
Adaptive quantization with auto-variance and better edge preservation.
-
Adaptive quantization with auto-variance, better edge preservation, and bias to dark scenes. Only in aMod.
-
hevc-aq"scales the quantization step size according to the spatial activity of one coding unit relative to frame average spatial activity. This AQ method utilizes the minimum variance of sub-unit in each coding unit to represent the coding unit's spatial complexity." Like most of the x265 documentation, this sounds a lot fancier than it is. Don't enable with other modes turned on.
-
-
--aq-strengthbetween0.80and1.40for AQ modes 1-3 or0.50and1.00for AQ mode 4. -
--aq-bias-strengthbetween0.50and1.20if using aMod and an AQ mode with dark bias. This is a multiplier with lower numbers lowering the bias. Default is1.00. -
--deblock -4:-4to0:0, similar to x264. Test at least -3:-3 to -1:-1 with live action, -2:-2 to 0:0 with animation. -
--ipratioand--pbratiosame as x264 again. -
--psy-rd 0.80to2.00, similar-ish effect to x264. Values are generally higher than with x264, though. -
--psy-rdoqanything from0.00to2.00usually. -
--no-saois usually best, but if your encode suffers from a lot of ringing, turn SAO back on. SAO does tend to blur quite heavily. -
--no-strong-intra-smoothingon sharp/grainy content, you can leave this on for blurry content, as it's an additional blur that'll help prevent banding.