Configure uhd-bd Option in FFmpeg libx265

This guide explains how to configure the uhd-bd option in the FFmpeg libx265 encoder to produce Ultra HD Blu-ray compatible HEVC videos. You will learn the required FFmpeg syntax, key parameter combinations, and a practical command-line example to ensure your encoded video adheres to official UHD Blu-ray specifications.

Enabling the uhd-bd Option

The uhd-bd option is a flag within the libx265 encoder that restricts the encoding process to comply with the Ultra HD Blu-ray specification. To enable this option in FFmpeg, you must pass it inside the -x265-params argument.

The basic syntax for enabling the option is:

-c:v libx265 -x265-params uhd-bd=1

Mandatory Complementary Settings

Simply enabling uhd-bd=1 is not enough to create a fully compliant UHD Blu-ray stream. You must also configure specific color depths, chroma subsampling, and Video Buffer Verifier (VBV) settings.

Full Command Example

Below is a complete FFmpeg command to transcode a video into a compliant UHD Blu-ray HEVC stream:

ffmpeg -i input.mp4 -c:v libx265 -pix_fmt yuv420p10le \
-x265-params uhd-bd=1:vbv-maxrate=100000:vbv-bufsize=100000:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:aud=1:repeat-headers=1 \
-c:a copy output.ts

Parameter Breakdown: