Encode HDR Video with libvpx-vp9

High Dynamic Range (HDR) video offers enhanced color depth and contrast, but encoding it correctly requires specific metadata and profile parameters. This guide outlines the strictly required command line arguments needed to encode HDR video content using the FFmpeg libvpx-vp9 encoder, ensuring your output retains its HDR properties and plays back correctly on compatible displays.

To successfully encode HDR10 (the most common HDR format) using the VP9 codec, you must use FFmpeg with the libvpx-vp9 library. The following command line arguments are strictly required to trigger 10-bit encoding and pass the correct color metadata to the decoder:

ffmpeg -i input.mp4 -c:v libvpx-vp9 -profile:v 2 -pix_fmt yuv420p10le -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020nc output.webm

Required Arguments Explained