Vapoursynth HDR10 to SDR (DG): Difference between revisions

From wiki.selur.net
Jump to navigation Jump to search
New page: HDR10 to SDR (DG) (via create-page on MediaWiki MCP Server)
 
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server)
 
(One intermediate revision by the same user not shown)
Line 42: Line 42:
== Example ==
== Example ==
Default settings on an HDR10 source:
Default settings on an HDR10 source:
<syntaxhighlight lang="python">
<pre>
# adjusting color space from YUV420P10 to YUV420P16 for vsHDR10ToSDRDG
# adjusting color space from YUV420P10 to YUV420P16 for vsHDR10ToSDRDG
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P16)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P16)
# adjusting color using HDR to SDR (DG)
# adjusting color using HDR to SDR (DG)
clip = core.dghdrtosdr.DGHDRtoSDR(clip, impl="255", mode="pq", fulldepth=False, white=300, gamma=0.42, r=1.00, g=1.00, b=1.15, tm=0.90, roll=0.70, hue=0.00)
clip = core.dghdrtosdr.DGHDRtoSDR(clip, impl="255", mode="pq", fulldepth=False, white=300, gamma=0.42, r=1.00, g=1.00, b=1.15, tm=0.90, roll=0.70, hue=0.00)
</syntaxhighlight>
</pre>


== How Hybrid calls it ==
== How Hybrid calls it ==
Line 59: Line 59:
=== DGHDRtoSDR ===
=== DGHDRtoSDR ===
DGHDRtoSDR is a closed-source plugin by Donald Graft (DGDecNV author), distributed as the package vapoursynth-dghdrtosdr. It takes YUV420P16 input and outputs 8-bit YV12 or 10-bit in P16; ''impl="sw"'' selects the software path. The same conversion is built into DGDecNV's DGSource as its h2s options.
DGHDRtoSDR is a closed-source plugin by Donald Graft (DGDecNV author), distributed as the package vapoursynth-dghdrtosdr. It takes YUV420P16 input and outputs 8-bit YV12 or 10-bit in P16; ''impl="sw"'' selects the software path. The same conversion is built into DGDecNV's DGSource as its h2s options.
=== VapourSynth ===
Not a core filter; the VapourSynth documentation has no page for it.


=== AviSynth ===
=== AviSynth ===
DGHDRtoSDR is also available for AviSynth (DGDecNV package); the AviSynth+ documentation has no page for it.
DGHDRtoSDR is also available for AviSynth (DGDecNV package).


== Sources ==
== Sources ==

Latest revision as of 09:50, 16 November 2026

HDR10 to SDR (DG) converts HDR10 (PQ) or HLG video to SDR with Donald Graft's DGHDRtoSDR, on an NVIDIA GPU (CUDA) or in software.

Filtering → Vapoursynth → Color → Conversion

HDR10 to SDR (DG) controls in Hybrid
HDR10 to SDR (DG) controls in Hybrid

What it does

DGHDRtoSDR applies a Reinhard-based tone mapping with a soft rolloff, adjusts gamma, saturation per channel and hue, and outputs SDR video: 8-bit 4:2:0, or with Full depth 10-bit SDR stored in 16-bit 4:2:0.

Requirements

  • Windows only.
  • The DGHDRtoSDR plugin (shipped with Hybrid). An NVIDIA GPU is used when present; without one Hybrid ticks Software.

Settings

Control Parameter Range / values Hybrid default Meaning
Mode mode pq, hlg pq Transfer of the source: PQ (HDR10) or HLG.
White white 1 – 4000 (pq), 1 – 10000 (hlg), integer 300 White level of the output; higher values give a brighter result.
Black black 0 – 1000, integer 0 Black level; HLG only.
Gamma gamma 0 – 10 0.42 Output gamma (0.42 matches Rec.709).
Saturation (R/G/B) r, g, b 0 – 10 each 1.00 / 1.00 / 1.15 Saturation per channel.
ToneMap tm 0 – 1 0.90 Blend between Reinhard tone mapping (1.0) and plain clipping of the highlights (0.0).
Rolloff roll 0 – 1 0.70 Rolloff of the tone mapping; lower values add contrast and saturation. It also changes the overall brightness, so White may need adjusting.
Hue hue -1 – 1 0.00 Hue shift; positive values shift towards red.
Full depth fulldepth on/off off Output 10-bit SDR in 16-bit 4:2:0 instead of 8-bit 4:2:0.
Software impl="sw" on/off off (on without NVIDIA GPU) Run on the CPU instead of CUDA.
Device impl 0 – 255 255 CUDA device; 255 picks automatically. Disabled with Software.

Example

Default settings on an HDR10 source:

# adjusting color space from YUV420P10 to YUV420P16 for vsHDR10ToSDRDG
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P16)
# adjusting color using HDR to SDR (DG)
clip = core.dghdrtosdr.DGHDRtoSDR(clip, impl="255", mode="pq", fulldepth=False, white=300, gamma=0.42, r=1.00, g=1.00, b=1.15, tm=0.90, roll=0.70, hue=0.00)

How Hybrid calls it

  • The plugin needs YUV420P16; Hybrid converts the clip first.
  • All values shown in the GUI are written to the script (the plugin's own defaults are not documented); black only in HLG mode.
  • After the filter Hybrid treats the clip as 8-bit 4:2:0 (16-bit with Full depth) with BT.709 matrix.
  • Only one tone mapper can be active: switching on HDR10 to SDR (DG) switches off HDR10ToSDR, ToneMap (Placebo), ColorMatrix and FFmpeg tone mapping.
  • HDR10 to SDR (DG) also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

DGHDRtoSDR

DGHDRtoSDR is a closed-source plugin by Donald Graft (DGDecNV author), distributed as the package vapoursynth-dghdrtosdr. It takes YUV420P16 input and outputs 8-bit YV12 or 10-bit in P16; impl="sw" selects the software path. The same conversion is built into DGDecNV's DGSource as its h2s options.

AviSynth

DGHDRtoSDR is also available for AviSynth (DGDecNV package).

Sources