Inject Dolby Vision Metadata with SVT-AV1
This article provides a step-by-step guide on how to inject Dolby
Vision dynamic metadata into an AV1 video stream using the SVT-AV1
encoder (libsvtav1). You will learn how to extract the
Dolby Vision Reference Picture Unit (RPU) from a source video and pass
it to the encoder using FFmpeg or the standalone SVT-AV1 application to
produce a HDR10-compatible Dolby Vision AV1 file.
Prerequisites
To inject Dolby Vision metadata using SVT-AV1, you need: *
SVT-AV1 (v1.4.0 or higher): Older versions do not
support Dolby Vision RPU parsing. * FFmpeg compiled
with libsvtav1 support. * dovi_tool: A
command-line utility used to read, write, and edit Dolby Vision metadata
(RPU files). * A Dolby Vision source file (typically Profile 5, Profile
7, or Profile 8).
Step 1: Extract the Dolby Vision RPU
Before encoding, you must extract the Dolby Vision metadata (the RPU file) from your source video.
Using dovi_tool, run the following command to extract
the RPU:
dovi_tool extract-rpu input_source.mkv -o rpu.binThis command parses the source file and outputs a raw metadata file
named rpu.bin.
Step 2: Encode and Inject RPU using FFmpeg
You can pass the extracted rpu.bin directly to the
libsvtav1 encoder wrapper in FFmpeg using the
-svtav1-params flag.
FFmpeg Command
ffmpeg -i input_source.mkv -pix_fmt yuv420p10le -c:v libsvtav1 \
-svtav1-params "dolby-vision-rpu=rpu.bin:dolby-vision-profile=81" \
-c:a copy output.mkvParameter Breakdown:
-pix_fmt yuv420p10le: Forces 10-bit color depth, which is required for Dolby Vision and HDR10.dolby-vision-rpu=rpu.bin: Specifies the path to the extracted RPU metadata file.dolby-vision-profile=81: Specifies the Dolby Vision profile. Profile81(Profile 8.1) is highly recommended for AV1 because it offers fallback compatibility with standard HDR10 players. Other supported profiles include10(Profile 10, typically used for AV1 without HDR10 fallback).
Step 3: Alternative Method via Standalone SvtAv1EncApp
If you prefer to use the standalone SVT-AV1 encoder executable
(SvtAv1EncApp) instead of FFmpeg, you can pipe decoded
video from FFmpeg and specify the Dolby Vision arguments directly.
ffmpeg -i input_source.mkv -f yuv4mpegpipe -strict -1 - | \
SvtAv1EncApp -i stdin \
--dolby-vision-rpu rpu.bin \
--dolby-vision-profile 81 \
-b output.ivfOnce the .ivf file is generated, you can remux it back
into an MKV or MP4 container along with the original audio using FFmpeg
or MKVToolNix.
Verifying the Output
To verify that the Dolby Vision metadata was successfully injected
into your newly encoded AV1 file, use MediaInfo to inspect
the output file.
Look for the following lines in the video track properties:
HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible
If MediaInfo displays “Dolby Vision” alongside “HDR10 compatible” (for Profile 8.1), the injection was successful.