Good x265 Settings (Mar 2022 update, merged to v11.1)

  • x265 is just too complex to figure out for past myself, so after watched too much lectures and papers, testing myself and checking forums, here I'm giving out parameters years late. I'll try deleting the old posts regarding x265 as well. In this post I'll give out 6 combinations, and explain key features of each. Since x265 has hundreds of parameters to tackle with, I'll remove all the customizations and just give the fixed amounts. :*

    Note: --strong-intra-smoothing filter is enabled, because it's a parallel feature with 3-tap filter in intra frame search. It only applies in specific conditions according to the formula, and makes overall encoding faster with minor quality loss. Data smoothing is also not blurring which preserves patterned details.

    Note: I'm more of an enthusiast instead the expert, the borderline inbetween expert and enthusiast is probably being able to read and explain rate distorsion function where everything becomes university master/doctor level, so please don't exprect these parameters to be prefect

    General Purpose for video platforms

    Simple and quite effective, less capable at compressing some scenes, qpmax is still configured for perserving output quality, YUV4:2:0 8bit, 10bit

    Block Splitting - Transformation: --min-cu-size 16 --limit-tu 1 --tu-intra-depth 2 --tu-inter-depth 2

    ME - Compensation: --me umh --subme 5 --merange 48 --rskip 1 --weightb
    Referencing - Rate Control: --ref 3 --early-skip --max-merge 2 --no-open-gop --min-keyint 5 --fades --bframes 11 --b-adapt 2 --radl 2 --fast-intra

    Various Parameter Sets: --opt-qp-pps --opt-ref-list-length-pps

    Intraframe Search: --fast-intra

    Quantization: --crf 18 --crqpoffs -3 --cbqpoffs --qpmax 26

    Adaptive Quant: --aq-mode 3 --aq-motion --qg-size 16

    RDO - Mode Decision: --rd 3 --rdpenalty 1 --splitrd-skip --rdoq-level 1 --limit-modes --rect --tskip-fast
    Sample Adaptive Offset: --limit-sao --sao-non-deblock
    Output: --hash crc --allow-non-conformance

    Multiple CPU nodes: --pools +,-

    Standard for video platforms

    Takes more compute resources, no advantage against General Purpose in simpler scenes, YUV4:2:0, 4:2:2, 4:4:4 8bit, 10bit

    Block Splitting - Transformation: --min-cu-size 16 --tu-intra-depth 3 --tu-inter-depth 4 --limit-tu 1

    ME - Compensation: --me star --subme 5 --merange 48 --rskip 1 --weightbReferencing - Rate Control: --ref 3 --max-merge 2 --early-skip --no-open-gop --min-keyint 5 --keyint 390 --fades --bframes 13 --b-adapt 2 --radl 3

    Various Parameter Sets: --opt-qp-pps --opt-ref-list-length-pps

    Intraframe Search: --fast-intra

    Quantization: --crf 20.5 --crqpoffs -4 --cbqpoffs -2 --qpmax 26

    RDOQ: --rdoq-level 2

    Adaptive Quant: --aq-mode 3 --aq-strength 0.9 --aq-motion --qg-size 16

    Mode Decision: --rd 3 --rdpenalty 1 --splitrd-skip --rdoq-level 1 --limit-modes --rect

    Rate Distorsion Optimization: --psy-rd 1.6 --rdpenalty 2 --splitrd-skip

    Deblocking: --deblock 0:0Sample Adaptive Offset: --limit-sao --sao-non-deblock
    Output: --hash crc --allow-non-conformance

    Multiple CPU nodes: --pools +,-

    NAS/Server playback recovery: --idr-recovery-sei

    High Compression - Film

    Burst high bitrate scenes will be compressed. Not recommended for video platforms, recommend shifting chroma plane resolution up for this one: YUV4:2:2, 4:4:4 8bit, 10bit

    Block Splitting - Transformation: --min-cu-size 16 --tu-intra-depth 4 --tu-inter-depth 4

    ME - Compensation: --me star --subme 5 --merange 48 --rskip 1 --weightb

    Referencing - Rate Control: --ref 3 --max-merge 4 --early-skip --no-open-gop --min-keyint 2 --keyint 400 --fades --bframes 15 --b-adapt 2 --radl 3

    Various Parameter Sets: --opt-qp-pps --opt-ref-list-length-pps

    Intraframe Search: --constrained-intra --b-intra

    Quantization: --crf 21 --qpmin 10 --crqpoffs -3 --cbqpoffs -1 --hrd --vbv-bufsize 30000 --vbv-maxrate 50000

    RDOQ: --rdoq-level 2

    Adaptive Quant: --aq-mode 2 --aq-strength 0.9 --qg-size 8

    Mode Decision: --rd 5 --rdpenalty 1 --splitrd-skip --rskip 0 --limit-modes --rect --amp

    Rate Distorsion Optimization: --psy-rd 1.9 --rdpenalty 1 --rd-refine

    Deblocking: --deblock 0:0

    Sample Adaptive Offset: --sao-non-deblock --selective-sao 3Output: --hash crc --allow-non-conformance --nr-inter 5 --nr-intra 5

    Multiple CPU nodes: --pools +,-

    NAS/Server playback recovery: --idr-recovery-sei

    Render to Reuse (video editor --> video editor)

    Some filters costs too much computing resources, therefore render a finished video and re-import is cost saving. Not sure when will premiere support hevc, but voukoder is not just for premiere, so this should still be useful: YUV4:2:2 8bit, 10bit

    Block Splitting - Transformation: --ctu 32

    ME - Compensation - Intrasearch: --me star --subme 6 --merange 48 --analyze-src-pics --weightb --max-merge 4 --early-skip --b-intra

    Referencing - Rate Control: --ref 3 --no-open-gop --min-keyint 1 --keyint 350 --fades --bframes 7 --b-adapt 2

    Various Parameter Sets: --opt-qp-pps --opt-ref-list-length-pps

    Quantization: --crf 17 --qpmax 24

    Mode Decision: --rd 5 --limit-modes --limit-refs 1 --rskip 1

    Deblocking: --deblock 0:0

    Sample Adaptive Offset: --no-sao

    Output - Mastering: --hash crc --allow-non-conformance --tune grain

    Multiple CPU nodes: --pools +,-

    NAS/Server playback recovery: --idr-recovery-sei

    High Compression - Anime

    For subtitle/translation groups and uploading to video platform. This parameter considers both high and low budget anime, include opening, ending and main content. The secret is to max out all the possible block splittings possible, because high-freq info here are mostly hand drawings and should be perserved: YUV4:2:0 8bit, 10bit

    Block Splitting - Transformation: --ctu 64 --min-cu-size 8 --tu-intra-depth 4 --tu-inter-depth 4 --max-tu-size 4 --limit-tu 1

    ME - Compensation: --me star --merange 48 --analyze-src-pics --subme 3 --weightb --max-merge 4 --early-skip

    Referencing - Rate Control: --ref 3 --no-open-gop --min-keyint 5 --keyint 360 --fades --bframes 15 --b-adapt 2 --radl 2

    Various Parameter Sets: --opt-qp-pps --opt-ref-list-length-pps

    Intraframe Search: --b-intra

    Quantization: --crf 20 --crqpoffs -3 --cbqpoffs -1 --cu-lossless

    RDOQ: --psy-rdoq 2.3 --rdoq-level 2

    Adaptive Quant: --aq-mode 3 --aq-strength 0.7 --qg-size 8

    Mode Decision: --rd 5 --limit-modes --limit-refs 1 --rskip 1 --rect --amp

    Rate Distorsion Optimization: --psy-rd 1.5 --rd-refine --splitrd-skip

    Deblocking: --deblock 0:0

    Sample Adaptive Offset: --limit-sao --sao-non-deblock

    Output: --hash crc --allow-non-conformance --single-sei

    Multiple CPU nodes: --pools +,-

    NAS/Server playback recovery: --idr-recovery-sei

    High Quality - Anime BDRip Coldwar Duels

    For Blue-ray DVD Ripper social network's common agreement on: high quality encoding means "paused dark scene zoomed-in 4~5 times size" should look just as good as the source footage, and I bet the x265 devs will freakout after reading that line, but that's reality on why some BDRip providers/groups are decent but gets less downloads:S . Compare to HC-Anime, x265 needs to give up some compression features to realize this requirement: YUV4:2:0 8bit, 10bit

    Block Splitting - Transformation: --ctu 64 --min-cu-size 8 --tu-intra-depth 4 --tu-inter-depth 4 --max-tu-size 4 --limit-tu 1

    ME - Compensation: --me star --merange 52 --analyze-src-pics --subme 3 --weightb --max-merge 4 --early-skip

    Referencing - Rate Control: --ref 3 --no-open-gop --min-keyint 1 --keyint 360 --fades --bframes 11 --b-adapt 2 --radl 2 --pbratio 1.2

    Various Parameter Sets: --opt-qp-pps --opt-ref-list-length-pps

    Intraframe Search: --b-intra

    Quantization: --crf 18.5 --crqpoffs -5 --cbqpoffs -3 --cu-lossless

    RDOQ: --psy-rdoq 2.3 --rdoq-level 2

    Adaptive Quant: --aq-mode 3 --aq-strength 0.7 --qg-size 8 --aq-motion

    Mode Decision:  --rd 5 --limit-modes --limit-refs 1 --rskip 2 --rskip-edge-threshold 2 --rect --amp --no-cutree

    Rate Distorsion Optimization: --psy-rd 1.5 --rd-refine --splitrd-skip

    Deblocking: --deblock 0:0

    Sample Adaptive Offset: --no-sao

    Output: --hash md5 --allow-non-conformance --single-sei

    Multiple CPU nodes: --pools +,-

    NAS/Server playback recovery: --idr-recovery-sei

    Thats it. <3

    Einmal editiert, zuletzt von iAvoe (22. März 2022 um 01:05) aus folgendem Grund: Font size error

  • iAvoe 21. März 2022 um 22:23

    Hat den Titel des Themas von „Good x265 parameters (Mar 2022 update, sorry for the delay)“ zu „Good x265 Settings (Mar 2022 update, sorry for the delay)“ geändert.
  • HDR Support (x264 & x265):

    Tagging DCI-P3: --master-display G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(?,1)

    Tagging BT.709: --master-display G(15000,30000)B(7500,3000)R(32000,16500)WP(15635,16450)L(?,1)

    TaggingBT2020: --master-display G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(?,1)

    The L(?,1) indicates lux ratio (e.g., 1000:1). This value has no standard and needs to be checked and written manually on each HDR video.

    If tagging for the source vid is unknown, find 1 of the following format in source video metadata:

    DCI-P3: G(x0.265, y0.690), B(x0.150, y0.060), R(x0.680, y0.320), WP(x0.3127, y0.329)

    bt.709: G(x0.30, y0.60), B(x0.150, y0.060), R(x0.640, y0.330), WP(x0.3127,y0.329)

    bt.2020: G(x0.170, y0.797), B(x0.131, y0.046), R(x0.708, y0.292), WP(x0.3127,y0.329)

    Content lumiance x265: --max-cll <max content light level cd/m2, max frame-avg light level cd/m2> e.g., 1000,640

    Content lumiance x264: --cll <max content light level cd/m2, max frame-avg light level cd/m2> e.g., 1000,640

    CLL has no standard and needs to be checked and written manually on each HDR video

    Indicate HDR10 content in supplemential enhance info (SEI),  x264 --hdr10

    Optimize HDR10 content (increase video size) per block (optional, x264 ): --hdr10-opt

    Indicate color range and transfer properties: --colormatrix <as source> --transfer <as source>

    Color range can vary thanks for both compatibility and multple HDR implementations, (e.g., gbr bt709 fcc bt470bg smpte170m YCgCo bt2020nc bt2020c smpte2085 ictcp). Check the source video metadata for them

    2 Mal editiert, zuletzt von iAvoe (22. März 2022 um 04:21) aus folgendem Grund: Somehow the font size is just keep going wrong...

  • It seems that voukoder is still using x265 v3.4. These parameters are build around v3.5 and since x265 devs sometimes change the parameter name and enabling-disabling some feature, it's better wait for a new Voukoder release before impementing them

  • iAvoe 18. Juni 2022 um 05:09

    Hat den Titel des Themas von „Good x265 Settings (Mar 2022 update, sorry for the delay)“ zu „Good x265 Settings (Mar 2022 update, merged to v11.1)“ geändert.