Vapoursynth HDR10ToSDR

From wiki.selur.net
Revision as of 18:59, 14 November 2026 by Selur (talk | contribs) (New page: HDR10ToSDR (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

HDR10ToSDR converts HDR10 video (PQ transfer, BT.2020) to SDR with a fixed tone mapping curve, on the CPU.

Filtering → Vapoursynth → Color → Conversion

HDR10ToSDR controls in Hybrid
HDR10ToSDR controls in Hybrid

What it does

The clip is converted to linear 32-bit float RGB, tone mapped and converted to the chosen target format, matrix, primaries and range.

  • Hable: a filmic curve. It desaturates colors near the clipping point (Desat) and keeps the range below 100 nits linear, so normal picture content is not compressed.
  • Simple: the same kind of curve with a fixed saturation blend.

Requirements

  • The input must be HDR10: limited-range BT.2020 YUV with PQ transfer. Hybrid does not check this; HLG or full-range sources are converted wrongly.

Settings

Control Parameter Range / values Hybrid default Meaning
Method – Hable, Simple Hable Tone mapping curve.
Peak source_peak 1 – 10000 1000 Peak brightness of the source in nits.
Desat desat 0 – 100 50 How strongly very bright colors are desaturated. Hable only.
Color location color_loc left, center, top_left, top, bottom_left, bottom center Chroma siting of the output.
Target format tFormat YUV 4:2:0/4:2:2/4:4:4/4:1:0/4:1:1/4:4:0 at 8 bit; 4:2:0/4:2:2/4:4:4 at 10, 12, 16 bit; YUV444PH, YUV444PS YUV420P8 Format of the output.
Target matrix tMatrix 709, 470bg, 170m, ycgco 709 Matrix of the output; the primaries and transfer follow it (BT.709 for 709 and ycgco, BT.601 for 470bg and 170m).
Target range tRange limited, full limited Range of the output.
Tools: Expr tools akarin, cranexpr, std akarin (std without AVX2) Expression evaluator.
Tools: Limiter tools vszip, std vszip Plugin that clamps the tone mapped values.

Example

Default settings on an HDR10 source:

# adjusting color using HDR10toSDR
clip = color.hablehdr10tosdr(clip, source_peak=1000, desat=50, tFormat=vs.YUV420P8, tMatrix="709", tRange="limited", color_loc="center", lin=True, show_satmask=False, show_clipped=False, tools={'expr': 'akarin', 'limiter': 'vszip'})

How Hybrid calls it

  • The filter accepts any YUV input and does no conversion before it.
  • The Hable method also gets lin (linear range below 100 nits, always on) and the debug switches show_satmask/show_clipped (always off); they have no controls.
  • After the filter Hybrid uses the target format, its bit depth, the target matrix and the target range as the clip's state.
  • Only one tone mapper can be active: switching on HDR10ToSDR switches off HDR10 to SDR (DG), ToneMap (Placebo), ColorMatrix and FFmpeg tone mapping.
  • HDR10ToSDR also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

The script

Both methods are functions of Hybrid's color script collection. They convert the input to linear RGBS (assuming BT.2020, PQ and limited range, nominal luminance 1000 nits), apply the tone mapping curve with expressions and convert the result with resize.Bicubic (ordered dither) to the target format.

VapourSynth

Not a core filter; the conversions use the core resizers.

AviSynth

The AviSynth+ documentation has no HDR tone mapping core filter.

Sources