Version 3 (modified by slhck, 5 years ago) (diff)

give a bit more context

FFmpeg and H.265 Encoding Guide

The goal of this guide is to inform new users how to create a high-quality H.265 video using the encoder x265. Note: libx265 is under heavy development. The API may change.

H.265 (also known as HEVC) offers 50-75% compression efficiency compared to an H.264 video, while retaining the same quality. Similar to x264, the x265 encoder has multiple rate control algorithms, including:

  • 1-pass constant bitrate
  • 2-pass constant bitrate
  • Constant Rate Factor (CRF)

Constant Rate Factor (CRF)

In this guide we are going with CRF encoding. Use this mode if you want to retain a good quality and don't care about bitrate or filesize. It works exactly the same as in x264, so read the H.264 guide for more info.

In this example, we will use the default CRF of 28, the "medium" profile, and AAC audio at 128 kBit/s. The CRF of 28 should visually correspond to libx264 video at CRF 23, but result in about half the file size. The profile determines how fast the encoding process will be – at the expense of compression efficiency.

ffmpeg -i input -c:v libx265 -preset medium -x265-params crf=28 -c:a aac -strict experimental -b:a 128k output.mp4

Generally, options are passed to x265 with the -x265-params argument.

Further Info

x265 API documentation