x265 Recommendations for FFmpeg

x265 Parameters

Quick command line snippets for use in ffmpeg:

24 fps:

    -x265-params no-open-gop=1:keyint=240:gop-lookahead=12:bframes=6:weightb=1:hme=1:strong-intra-smoothing=0:rect=0:aq-mode=4
  

25 fps:

    -x265-params no-open-gop=1:keyint=250:gop-lookahead=12:bframes=6:weightb=1:hme=1:strong-intra-smoothing=0:rect=0:aq-mode=4
  

30 fps:

    -x265-params no-open-gop=1:keyint=300:gop-lookahead=12:bframes=6:weightb=1:hme=1:strong-intra-smoothing=0:rect=0:aq-mode=4
  

50 fps:

    -x265-params no-open-gop=1:keyint=500:gop-lookahead=11:bframes=7:weightb=1:hme=1:strong-intra-smoothing=0:rect=0:aq-mode=4
  

60 fps:

    -x265-params no-open-gop=1:keyint=600:gop-lookahead=11:bframes=7:weightb=1:hme=1:strong-intra-smoothing=0:rect=0:aq-mode=4
  

x265 Quality Settings

Pretty much just use -crf 23.

23 is about the equivalent of 21 or 20 for x264.

x265 Parameters

Good general parameters:

aq-mode=4 — use adaptive quantization with auto-variance and edge information

no-open-gop=1 — use closed GOP

weightb=1 — enable weighted prediction in B slices

hme=1 — enable hierarchical motion estimation

strong-intra-smoothing=0

rect=0

Parameters that depend on frame rate:

Frames per second keyint bframes gop-lookahead
24 240 6 12
25 250 6 12
30 300 6 12
50 500 7 11
60 600 7 11

References

  1. https://x265.readthedocs.io/en/stable/cli.html
  2. http://forum.doom9.net/showthread.php?p=1873696
  3. https://forum.videohelp.com/threads/395551-Should-I-use-no-sao-when-encoding-with-HEVC
  4. http://forum.doom9.net/showthread.php?p=1823613