dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
Rust
1,023
430 commits
updated Sep 13, 2026
dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
The dolby_vision crate is also hosted in this repo, see README for use as a Rust/C lib.
The C compatible library is also known as libdovi, refer to the same document for building/installing.
The minimum Rust version to build dovi_tool is 1.88.0.
On Linux systems, fontconfig is required.
Alternatively, system fonts can be bypassed by building with --no-default-features --features internal-font.
To build release binary in target/release/dovi_tool run:
cargo build --release
dovi_tool [OPTIONS] <SUBCOMMAND>
To get more detailed options for a subcommand
dovi_tool <SUBCOMMAND> --help
--help, --version, --crop, --drop-hdr10plus, --mode, --edit-config, --start-codeinfo, generate, editor, export, plotconvert, demux, mux, extract-rpu, inject-rpuMore information and detailed examples for the subcommands below.
dovi_tool provides an important set of tools for analyzing, editing and generating Dolby Vision metadata.
Prints the parsed RPU information.
To get the summary, use --summary or -s.
Using --frame: prints the RPU data as JSON for a specific frame.
Example to get metadata for frame 124:
dovi_tool info -i RPU.bin -f 123
Allows generating a binary RPU from different sources.
The binary RPU can be created with support for the following metadata levels:
Both per-shot and per-frame trims are supported.
Level 5 metadata requires both canvas-width and canvas-height to be set.
Example:
dovi_tool generate --xml dolbyvision_metadata.xml -o RPU_from_xml.bin
See documentation: generator.md or examples
Example:
dovi_tool generate -j assets/generator_examples/default_cmv40.json -o RPU_generated.bin
The metadata is generated from a configuration JSON file, and the L1 metadata is derived from HDR10+ metadata.
The HDR10+ metadata must contain scene information for proper scene cuts.
Flags:
--hdr10plus-peak-source How to extract the peak brightness for the metadata [default: histogram]histogram, histogram99, max-scl, max-scl-luminanceExample:
dovi_tool generate -j assets/generator_examples/default_cmv40.json --hdr10plus-json hdr10plus_metadata.json -o RPU_from_hdr10plus.bin
The metadata is generated from a configuration JSON file, and the L1 metadata is derived from the madVR measurements.
Supports using custom targets nits from Soulnight's madMeasureHDR Optimizer, with flag --use-custom-targets.
Example:
dovi_tool generate -j assets/generator_examples/default_cmv40.json --madvr-file madmeasure-output.bin -o RPU_from_madVR.bin
Allows editing a binary RPU according to a JSON config. See documentation: editor.md or examples.
All indices start at 0, and are inclusive. For example, using "0-39" edits the first 40 frames.
Example:
dovi_tool editor -i RPU.bin -j assets/editor_examples/mode.json -o RPU_mode2.bin
Allows exporting a binary RPU file to text files containing relevant information.
The command allows specifying the desired data to export as file.
Default: export outputs the full RPU serialized to JSON (equivalent to --data all).
-d, --data: List of key-value export parameters formatted as key=output,key2...
all - Exports the list of RPUs as a JSON filescenes - Exports the frame indices at which scene_refresh_flag is set to 1level5 - Exports the video's L5 metadata in the form of an editor config JSON-l, --levels: Export specific extension metadata levels.
level1, level2... See dovi_tool export --help message.level1=output.csv,level2... to override default path.-f, --levels-format: Format to output levels exports, defaults to csv.
csv, json
Example to export the whole RPU list to JSON:
dovi_tool export -i RPU.bin -d all=RPU_export.json
Example to export both scene change frames and L5 metadata (with specific path)
dovi_tool export -i RPU.bin -d scenes,level5=L5.json
Allows plotting the RPU metadata into a graph.
The output is a PNG image.
Flags:
-t, --title The title to set at the top of the plot-s, --start Set frame range start-e, --end Set frame range end (inclusive)Plot options:
-p, --plot-type Sets the DV metadata level to plot [default: l1, brightness metadata]
Possible values: l1, l2, l8, l8-saturation, l8-hue
--target-nits Target brightness in nits for L2/L8 plots [default: 100]
Possible values: 100, 300, 600, 1000, 2000, 4000
--trims Trim parameters to include in L2/L8 trims plots. By default all are included.
Possible values: slope, offset, power, chroma, saturation, ms, mid, clip
L8 only: mid and clip.
Example:
dovi_tool plot RPU.bin -t "Dolby Vision L1 plot" -o L1_plot.png
# L2 plot
dovi_tool plot RPU.bin -p l2
For working with an HEVC source file, there are multiple options that apply to most commands:
-m, --mode Sets the mode for RPU processing.
0 - Parses the RPU, rewrites it untouched.1 - Converts the RPU to be MEL compatible.2 - Converts the RPU to be profile 8.1 compatible.
3 - Converts profile 5 to 8.1.4 - Converts to profile 8.4.5 - Converts to profile 8.1, preserving mapping.
-c, --crop Set active area offsets to 0 (meaning no letterbox bars).--drop-hdr10plus Ignore HDR10+ metadata when writing the output HEVC.--edit-config Path to editor config JSON file.
--start-code HEVC NALU start code to use when writing HEVC.
four (default), annex-bfour is the default, writing a 4-byte start code all the time.annex-b varies the start code, according to spec. Almost matches x265 behaviour.Converts RPU within a single layer HEVC file.
The enhancement layer can be discarded using --discard.
Examples to convert to profile 8.1 and discard EL:
dovi_tool -m 2 convert --discard file.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool -m 2 convert --discard -
Rust port of yusesope's python tool. Credits goes to them.
Demuxes single track dual layer Dolby Vision into Base layer and Enhancement layer files.
The base layer file output is equivalent to using the remove subcommand.
Flags:
--el-only Output the EL file only.Examples:
dovi_tool demux file.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool demux -
Example to convert RPU to profile 8.1 while demuxing:
dovi_tool -m 2 demux file.hevc
Interleaves the enhancement layer into a base layer HEVC bitstream.
This is the inverse of demux.
Muxing supports the base layer input as both raw HEVC bitstream and piped/streamed.
--no-add-aud Disable adding AUD NALUs between frames--remove-eos Removes EOS/EOB NALUs from both BL and EL, if present--discard Discard the EL while muxing. This is equivalent to injecting the RPU, but without extracting first.Examples:
dovi_tool mux --bl BL.hevc --el EL.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool mux --bl - --el EL.hevc
Example to convert RPU to profile 8.1 while muxing:
dovi_tool -m 2 mux --bl BL.hevc --el EL.hevc --discard
Extracts Dolby Vision RPU from an HEVC file.
Input file:
Supports profiles 4, 5, 7, and 8.
Flags:
-l, --limit Number of frames to process from the input. Processing stops after N frames.-t, --track-number Video track number to use when the input is a Matroska file.Examples:
dovi_tool extract-rpu video.hevc
# Directly using MKV file
dovi_tool extract-rpu video.mkv
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool extract-rpu - -o RPU.bin
FEL to MEL example:
dovi_tool -m 1 extract-rpu video.hevc
Interleaves RPU NAL units between slices in an HEVC encoded bitstream.
Global options have no effect when injecting.
Flags:
--no-add-aud Disable adding AUD NALUs between framesExample:
dovi_tool inject-rpu -i video.hevc --rpu-in RPU.bin -o injected_output.hevc
Removes the enhancement layer and RPU data from the video.
Outputs to a BL.hevc file by default.
Examples:
dovi_tool remove file.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool remove -
Build artifacts can be found in the Github Actions.
More features may or may not be added in the future.
1,875 followers · starred Jul 2021
2,482 followers · starred Apr 2026
16 followers · starred Nov 2021
32 followers · starred Mar 2023
Rust
97.7%
C
2.1%
dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
Rust
1,023
430 commits
updated Sep 13, 2026
dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
The dolby_vision crate is also hosted in this repo, see README for use as a Rust/C lib.
The C compatible library is also known as libdovi, refer to the same document for building/installing.
The minimum Rust version to build dovi_tool is 1.88.0.
On Linux systems, fontconfig is required.
Alternatively, system fonts can be bypassed by building with --no-default-features --features internal-font.
To build release binary in target/release/dovi_tool run:
cargo build --release
dovi_tool [OPTIONS] <SUBCOMMAND>
To get more detailed options for a subcommand
dovi_tool <SUBCOMMAND> --help
--help, --version, --crop, --drop-hdr10plus, --mode, --edit-config, --start-codeinfo, generate, editor, export, plotconvert, demux, mux, extract-rpu, inject-rpuMore information and detailed examples for the subcommands below.
dovi_tool provides an important set of tools for analyzing, editing and generating Dolby Vision metadata.
Prints the parsed RPU information.
To get the summary, use --summary or -s.
Using --frame: prints the RPU data as JSON for a specific frame.
Example to get metadata for frame 124:
dovi_tool info -i RPU.bin -f 123
Allows generating a binary RPU from different sources.
The binary RPU can be created with support for the following metadata levels:
Both per-shot and per-frame trims are supported.
Level 5 metadata requires both canvas-width and canvas-height to be set.
Example:
dovi_tool generate --xml dolbyvision_metadata.xml -o RPU_from_xml.bin
See documentation: generator.md or examples
Example:
dovi_tool generate -j assets/generator_examples/default_cmv40.json -o RPU_generated.bin
The metadata is generated from a configuration JSON file, and the L1 metadata is derived from HDR10+ metadata.
The HDR10+ metadata must contain scene information for proper scene cuts.
Flags:
--hdr10plus-peak-source How to extract the peak brightness for the metadata [default: histogram]histogram, histogram99, max-scl, max-scl-luminanceExample:
dovi_tool generate -j assets/generator_examples/default_cmv40.json --hdr10plus-json hdr10plus_metadata.json -o RPU_from_hdr10plus.bin
The metadata is generated from a configuration JSON file, and the L1 metadata is derived from the madVR measurements.
Supports using custom targets nits from Soulnight's madMeasureHDR Optimizer, with flag --use-custom-targets.
Example:
dovi_tool generate -j assets/generator_examples/default_cmv40.json --madvr-file madmeasure-output.bin -o RPU_from_madVR.bin
Allows editing a binary RPU according to a JSON config. See documentation: editor.md or examples.
All indices start at 0, and are inclusive. For example, using "0-39" edits the first 40 frames.
Example:
dovi_tool editor -i RPU.bin -j assets/editor_examples/mode.json -o RPU_mode2.bin
Allows exporting a binary RPU file to text files containing relevant information.
The command allows specifying the desired data to export as file.
Default: export outputs the full RPU serialized to JSON (equivalent to --data all).
-d, --data: List of key-value export parameters formatted as key=output,key2...
all - Exports the list of RPUs as a JSON filescenes - Exports the frame indices at which scene_refresh_flag is set to 1level5 - Exports the video's L5 metadata in the form of an editor config JSON-l, --levels: Export specific extension metadata levels.
level1, level2... See dovi_tool export --help message.level1=output.csv,level2... to override default path.-f, --levels-format: Format to output levels exports, defaults to csv.
csv, json
Example to export the whole RPU list to JSON:
dovi_tool export -i RPU.bin -d all=RPU_export.json
Example to export both scene change frames and L5 metadata (with specific path)
dovi_tool export -i RPU.bin -d scenes,level5=L5.json
Allows plotting the RPU metadata into a graph.
The output is a PNG image.
Flags:
-t, --title The title to set at the top of the plot-s, --start Set frame range start-e, --end Set frame range end (inclusive)Plot options:
-p, --plot-type Sets the DV metadata level to plot [default: l1, brightness metadata]
Possible values: l1, l2, l8, l8-saturation, l8-hue
--target-nits Target brightness in nits for L2/L8 plots [default: 100]
Possible values: 100, 300, 600, 1000, 2000, 4000
--trims Trim parameters to include in L2/L8 trims plots. By default all are included.
Possible values: slope, offset, power, chroma, saturation, ms, mid, clip
L8 only: mid and clip.
Example:
dovi_tool plot RPU.bin -t "Dolby Vision L1 plot" -o L1_plot.png
# L2 plot
dovi_tool plot RPU.bin -p l2
For working with an HEVC source file, there are multiple options that apply to most commands:
-m, --mode Sets the mode for RPU processing.
0 - Parses the RPU, rewrites it untouched.1 - Converts the RPU to be MEL compatible.2 - Converts the RPU to be profile 8.1 compatible.
3 - Converts profile 5 to 8.1.4 - Converts to profile 8.4.5 - Converts to profile 8.1, preserving mapping.
-c, --crop Set active area offsets to 0 (meaning no letterbox bars).--drop-hdr10plus Ignore HDR10+ metadata when writing the output HEVC.--edit-config Path to editor config JSON file.
--start-code HEVC NALU start code to use when writing HEVC.
four (default), annex-bfour is the default, writing a 4-byte start code all the time.annex-b varies the start code, according to spec. Almost matches x265 behaviour.Converts RPU within a single layer HEVC file.
The enhancement layer can be discarded using --discard.
Examples to convert to profile 8.1 and discard EL:
dovi_tool -m 2 convert --discard file.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool -m 2 convert --discard -
Rust port of yusesope's python tool. Credits goes to them.
Demuxes single track dual layer Dolby Vision into Base layer and Enhancement layer files.
The base layer file output is equivalent to using the remove subcommand.
Flags:
--el-only Output the EL file only.Examples:
dovi_tool demux file.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool demux -
Example to convert RPU to profile 8.1 while demuxing:
dovi_tool -m 2 demux file.hevc
Interleaves the enhancement layer into a base layer HEVC bitstream.
This is the inverse of demux.
Muxing supports the base layer input as both raw HEVC bitstream and piped/streamed.
--no-add-aud Disable adding AUD NALUs between frames--remove-eos Removes EOS/EOB NALUs from both BL and EL, if present--discard Discard the EL while muxing. This is equivalent to injecting the RPU, but without extracting first.Examples:
dovi_tool mux --bl BL.hevc --el EL.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool mux --bl - --el EL.hevc
Example to convert RPU to profile 8.1 while muxing:
dovi_tool -m 2 mux --bl BL.hevc --el EL.hevc --discard
Extracts Dolby Vision RPU from an HEVC file.
Input file:
Supports profiles 4, 5, 7, and 8.
Flags:
-l, --limit Number of frames to process from the input. Processing stops after N frames.-t, --track-number Video track number to use when the input is a Matroska file.Examples:
dovi_tool extract-rpu video.hevc
# Directly using MKV file
dovi_tool extract-rpu video.mkv
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool extract-rpu - -o RPU.bin
FEL to MEL example:
dovi_tool -m 1 extract-rpu video.hevc
Interleaves RPU NAL units between slices in an HEVC encoded bitstream.
Global options have no effect when injecting.
Flags:
--no-add-aud Disable adding AUD NALUs between framesExample:
dovi_tool inject-rpu -i video.hevc --rpu-in RPU.bin -o injected_output.hevc
Removes the enhancement layer and RPU data from the video.
Outputs to a BL.hevc file by default.
Examples:
dovi_tool remove file.hevc
ffmpeg -i input.mkv -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool remove -
Build artifacts can be found in the Github Actions.
More features may or may not be added in the future.
1,875 followers · starred Jul 2021
2,482 followers · starred Apr 2026
16 followers · starred Nov 2021
32 followers · starred Mar 2023
Rust
97.7%
C
2.1%