Skip to content

About

Convert any HDR10, HLG, or HDR10+ video to dynamic metadata

Resources

Contributing

Stars

11 stars

Watchers

0 watching

Forks

Repository files navigation

HDR-Analyze

CI License: MIT Rust

HDR-Analyze measures HDR10, HDR10+ and HLG video and converts it to Dolby Vision (Profile 8.1, or 8.4 for HLG) without re-encoding the picture.

HDR-Analyze is an independent project, not affiliated with or endorsed by Dolby Laboratories, and Dolby Vision is a Dolby trademark (provenance). Current version: 0.7.0.

What you get

  • HDR10 and HDR10+ files become Profile 8.1 MKVs, and HLG files become Profile 8.4 MKVs. The video stream is copied, not re-encoded: mkvdovi never encodes video.
  • An open-source analysis engine that measures decoded pixels and writes per-scene L1 plus L2, L6, L9 and L11 metadata. dovi_tool generates and injects the RPU.
  • Direct analysis of the compressed source. You do not need a ProRes or raw intermediate.
  • Optional NVDEC decode and CUDA analysis that works on the decoded frames in GPU memory: about 325 fps (4K HDR10) and 490 fps (4K HLG) end to end on an RTX 4070 (details). Release binaries are CPU-only; GPU analysis needs a source build.
  • Published validation against synthetic references and Dolby-generated metadata, including an open gap on grainy content (docs/VALIDATION.md).

It also reuses existing HDR10+ metadata, audits RPUs with mkvdovi inspect, rebuilds metadata on existing Dolby Vision files with --mdfix, and runs on the CPU under Linux, macOS and Windows.

Quick start

Install the release binaries (Linux x64, macOS Intel and Apple Silicon, Windows x64):

curl -fsSL https://github.com/tinof/hdr-analyze/releases/latest/download/install.sh | bash

On Windows, download the zip from the latest release and keep the bundled FFmpeg DLLs next to the .exe files. A PowerShell install script also exists, but it has not been tested on Windows yet (details).

Convert a file:

mkvdovi movie.mkv --keep-source

The source file is deleted after a successful conversion unless you pass --keep-source. Inputs that already carry Dolby Vision metadata, and all --mdfix runs, keep the source.

Install these tools separately and put them on PATH. mkvdovi checks for all but the last one at startup:

Tool Needed for
ffmpeg every conversion
mkvmerge (MKVToolNix) final MKV packaging
dovi_tool 2.3.2 or newer RPU generation and injection (2.3.4+ reads MKV directly)
mediainfo (recommended) or ffprobe stream inspection. MediaInfo supplies the L6 and L9 source values; with ffprobe alone they fall back to defaults.
hdr10plus_tool HDR10+ input. An HDR10+ file fails if the tool is missing.

To build from source instead, run cargo build --release --workspace. For GPU analysis on an NVIDIA host, add cargo build --release -p hdr_analyzer_mvp --features cuda (needs the NVIDIA driver and NVRTC, no nvcc). FFmpeg dev libraries, clang and per-OS notes are in docs/INSTALLATION.md.

Compatibility

Input Output Picture re-encoded Maturity
HDR10 Profile 8.1, CM v4.0 metadata No Measurement comparisons published; playback unvalidated
HDR10+ Profile 8.1, L1 taken from HDR10+ No Measurement comparisons published; playback unvalidated
HLG Profile 8.4 (HLG base layer kept bit-exact), L1 measured through the 8.4 decode (luma and chroma curves); composer fitted to BT.2100 by default (--hlg-composer preset for the dovi_tool preset) No Decode validated against libplacebo; composer applied on an LG OLED C9
Dolby Vision Profile 7 MEL Profile 8.1 No Works
Dolby Vision Profile 7 FEL None: the file is refused – Not supported (plan)
Profile 8.1 or MEL with --mdfix (Profile 8.4 is refused) Profile 8.1 with rebuilt metadata No Works; not a guaranteed improvement

Flag-level detail is in docs/FORMAT_COMPATIBILITY.md and docs/CLI_REFERENCE.md.

Performance and validation

On an RTX 4070, CUDA analysis of 4K sources runs at about 325 fps (HDR10) and 490 fps (HLG), counted as frames ÷ wall time of the whole analyzer run, with L1 output identical to earlier builds. docs/PERFORMANCE.md records the test conditions and gives a reproduction recipe, and docs/CUDA_PIPELINE.md explains how the GPU path reaches these rates.

On synthetic patterns, measured peaks land within 0.25 of one 12-bit PQ code. On an asset with Dolby-generated reference metadata, max-RGB peaks read 12.8 codes high on average. HDR10+-derived L1 matched Dolby's v4 analyzer with a per-shot median error of 1 code (max 17), and scene detection matched 13 of 14 authored cuts while emitting 24 cuts in total.

The weak spot is grain. With the default max estimator, two grainy real-content assets read +74 and +93 codes hot against the reference. An opt-in grain-rejecting estimator (--peak-estimator, see the CLI reference) narrows this but does not close it.

CPU and GPU agreement shows the two paths are consistent. It says nothing about accuracy. The accuracy evidence is in docs/VALIDATION.md, and the remaining gaps are in docs/CM_ANALYZE_PARITY.md. The only playback comparison so far is the HLG composer test on an LG OLED C9 (docs/ROADMAP_LOG.md, 2026-10-13).

Why another HDR analyzer?

Dolby provides its own professional tools for this job. If you already use them and the workflow suits you, keep using it. HDR-Analyze exists for other situations:

  • You have HDR10, HDR10+ or HLG files and want Dolby Vision output (Profile 8.1, or 8.4 for HLG) from a command-line conversion.
  • Reading and changing the analysis code matters to you, down to how each metadata value is computed.
  • Your source is a delivered HEVC file and you would rather not export an intermediate first.
  • You have an NVIDIA GPU and want to use it for the measurement pass.
  • You want published error figures, including where the output is still wrong.

Limitations

  • The default peak estimator is sensitive to film grain (see above). The grain-rejecting estimator is opt-in (--peak-estimator robust, CPU and CUDA) and not yet accurate enough to be the default.
  • Profile 7 FEL input is not supported. mkvdovi refuses the file and keeps it. The earlier BL+EL compositor was removed because it did not match the Dolby Vision reconstruction specification (ETSI GS CCM 001) on real discs. A design that keeps the base layer bit-exact and re-encodes nothing is planned in docs/FEL_PLAN.md. mkvdovi inspect still reports FEL.
  • Hardware decode in the analyzer is CUDA only. VAAPI and VideoToolbox requests fall back to software decode.
  • There is no Profile 5 output and no XML metadata export.
  • The metadata is format-compatible with CM v4.0. It is produced by this project's own measurements and does not implement Dolby's analysis algorithm.
  • HLG sources become Profile 8.4. Player support for 8.4 is narrower than for 8.1 (Apple TV and LG TVs handle it; many players ignore the RPU and play the HLG base layer). HLG L1 is capped at the RPU's declared source range of about 1000 nits, so the brightest HLG codes (which the default 8.4 preset curves decode above it) read at that cap; peaks are max-RGB of the full 8.4 decode (luma and chroma curves). By default the RPU carries a composer fitted to the BT.2100 HLG-to-PQ conversion (docs/HLG_COMPOSER.md); --hlg-composer preset writes the dolby_vision crate's preset instead, which tints neutral greys slightly blue. A playback test showed that an LG OLED C9 applies the fitted composer; other devices are untested.
  • Playback has been compared on one display only: the HLG composer test on an LG OLED C9 (2026-10-13). HDR10, HDR10+ and other devices are untested.

Documentation

These files ship in each release archive next to this README. They are also online.

Contributing

This is a personal research project shared under the MIT license, with no support commitment. Issues and pull requests are welcome; see CONTRIBUTING.md. Run the same gates as CI before you commit:

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

Acknowledgements

quietvoid wrote dovi_tool, hdr10plus_tool and the MIT-licensed madvr_parse library. Decoding goes through FFmpeg via ffmpeg-next, and packaging through MKVToolNix.

License

MIT.

About

Convert any HDR10, HLG, or HDR10+ video to dynamic metadata

Resources

Contributing

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages