The official documentation for x265 is very good, so this page will only cover recommended values and switches.

Source-independent settings

  • --preset veryslow or slower

  • --no-rect for slower computers. There's a slight chance it'll prove useful, but it probably isn't worth it.

  • --no-amp is similar to rect, although it seems to be slightly more useful.

  • --no-open-gop

  • --no-cutree since this seems to be a poor implementation of mbtree.

  • --rskip 0 rskip is 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 60 although it's irrelevant as long as it's larger than min-keyint

  • --ref 6 for good CPUs, something like 4 for worse ones.

  • --bframes 16 or whatever your final bframes log output says.

  • --rd 3 or 4 (they're currently the same). If you can endure the slowdown, you can use 6, too, which allows you to test --rd-refine.

  • --subme 5. You can also change this to 7, but this is known to sharpen.

  • --merange 57 just don't go below 32 and you should be fine.

  • --high-tier

  • --range limited

  • --aud

  • --repeat-headers

Source-dependent settings

  • --output-depth 10 for 10-bit output.

  • --input-depth 10 for 10-bit input.

  • --colorprim 9 for HDR, 1 for SDR.

  • --colormatrix 9 for HDR, 1 for SDR.

  • --transfer 16 for HDR, 1 for SDR.

  • --hdr10 for HDR.

  • --hdr10-opt for 4:2:0 HDR, --no-hdr10-opt for 4:4:4 HDR and SDR.

  • --dhdr10-info /path/to/metadata.json for HDR10+ content with metadata extracted using hdr10plus_parser.

  • --dolby-vision-profile 8.1 specified Dolby Vision profile. x265 can encode only to profiles 5, 8.1, and 8.2

  • --dolby-vision-rpu /path/to/rpu.bin for 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/m2

    This 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.

  • --cbqpoffs and --crqpoffs should 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.

  • --qcomp between 0.60 and 0.80.

  • --aq-mode 4, 3, 2, 1, or --hevc-aq with 4 and 3 usually being the two best options. If using aMod, there is an extra mode 5. These do the following:

    1. Standard adaptive quantization, simply add more bits to complex blocks.

    2. Adaptive quantization with auto-variance.

    3. Adaptive quantization with auto-variance and bias to dark scenes.

    4. Adaptive quantization with auto-variance and better edge preservation.

    5. Adaptive quantization with auto-variance, better edge preservation, and bias to dark scenes. Only in aMod.

    6. 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-strength between 0.80 and 1.40 for AQ modes 1-3 or 0.50 and 1.00 for AQ mode 4.

  • --aq-bias-strength between 0.50 and 1.20 if using aMod and an AQ mode with dark bias. This is a multiplier with lower numbers lowering the bias. Default is 1.00.

  • --deblock -4:-4 to 0:0, similar to x264. Test at least -3:-3 to -1:-1 with live action, -2:-2 to 0:0 with animation.

  • --ipratio and --pbratio same as x264 again.

  • --psy-rd 0.80 to 2.00, similar-ish effect to x264. Values are generally higher than with x264, though.

  • --psy-rdoq anything from 0.00 to 2.00 usually.

  • --no-sao is 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-smoothing on sharp/grainy content, you can leave this on for blurry content, as it's an additional blur that'll help prevent banding.