videobeaux

Logo

The friendly multilateral video toolkit built for artists by artists.

View the Project on GitHub schwwaaa/videobeaux

tonemap_hdr_sdr

Description

Converts HDR footage (PQ/HLG) to SDR using tunable tonemapping curves, preserving highlight detail and color accuracy.

Purpose

Convert HDR content into display-safe SDR while preserving highlight detail, proper color relationships, and controlled contrast. This module applies filmic or mathematical tonemap curves to ensure smooth highlight rolloff and SDR-safe luminance.

How It Works

  1. Linearization
    HDR content is converted to linear light using:
    zscale=transfer=linear:npl=PEAK
  2. Tonemap Curve Application
    The selected operator (hable, mobius, reinhard, or clip) is applied via:
    tonemap=algo:desat=value
  3. SDR Color-Space Mapping
    After tonemap, the video is explicitly converted to:
    • BT.709 primaries
    • BT.709 transfer
    • BT.709 matrix
  4. Dithering & Pixel Format
    Dithering prevents banding; pixel format ensures compatibility.
  5. Encoding
    Output is encoded using libx264 unless overridden.

Program Template

videobeaux -P tonemap_hdr_sdr \
  -i input.mp4 \
  -o output.mp4 \
  --outfile VALUE \
  --algo VALUE \
  --desat VALUE \
  --peak VALUE \
  --dither VALUE \
  --pix_fmt VALUE \
  --x264_preset VALUE \
  --crf VALUE \
  --copy_audio VALUE

Arguments

Real World Example

videobeaux -P tonemap_hdr_sdr \
  -i myvideo.mp4 \
  -o tonemap_hdr_sdr_styled.mp4 \
  --outfile EXAMPLE \
  --algo EXAMPLE \
  --desat EXAMPLE \
  --peak EXAMPLE \
  --dither EXAMPLE \
  --pix_fmt EXAMPLE \
  --x264_preset EXAMPLE \
  --crf EXAMPLE \
  --copy_audio EXAMPLE

Technical Notes

Quality Tips