Overview
High Dynamic Range (HDR) video captures a wider range of brightness and colors than Standard Dynamic Range (SDR), providing:- Brighter highlights (up to 10,000 nits vs 100 nits for SDR)
- Deeper blacks with more shadow detail
- Wider color gamut (BT.2020 vs BT.709)
- More realistic and immersive viewing experience
HDR Standards
HDR10
Most Common HDR Format
- BT.2020 color primaries
- PQ (ST.2084) transfer function
- 10-bit color depth
- Static metadata
HLG
Broadcast HDR
- BT.2020 color primaries
- HLG transfer function
- Backward compatible with SDR
- No metadata needed
Dolby Vision
Premium HDR
- Dynamic metadata
- Proprietary encoding
- Best quality
- Limited support
HDR10+
Enhanced HDR10
- Dynamic metadata
- Scene-by-scene optimization
- Open standard
- Growing support
Quick Start: HDR10 Encoding
Color Space Parameters
Color Primaries
Defines the color gamut (range of colors):BT.2020 (Rec. 2020)
BT.2020 (Rec. 2020)
Wide Color Gamut for HDR
- Covers ~75% of visible colors
- Standard for HDR10, HLG
- Much wider than BT.709 (SDR)
- Used in UHD/4K content
BT.709 (Rec. 709)
BT.709 (Rec. 709)
Standard Dynamic Range
- Covers ~35% of visible colors
- Standard for HD TV, web video
- Most common color space
DCI-P3
DCI-P3
Digital Cinema / Apple Displays
- Covers ~45% of visible colors
- Used in cinema projection
- Native to Apple displays
- Between BT.709 and BT.2020
Transfer Function
Defines how brightness values are encoded:PQ (ST.2084) - HDR10
PQ (ST.2084) - HDR10
Perceptual Quantizer
- Absolute brightness encoding
- 0-10,000 nits range
- Best quality HDR
- Requires display calibration
- Most common HDR transfer function
HLG (Hybrid Log-Gamma)
HLG (Hybrid Log-Gamma)
Hybrid Log-Gamma
- Relative brightness encoding
- Backward compatible with SDR
- No metadata needed
- Common in broadcast
- Simpler than PQ
sRGB / BT.709
sRGB / BT.709
Standard Dynamic Range
- Gamma 2.2 / 2.4 encoding
- 0-100 nits range
- Used for SDR content
Matrix Coefficients
Defines RGB ↔ YUV conversion:Color Range
Complete HDR10 Example
HLG (Hybrid Log-Gamma) Encoding
HLG is simpler than PQ and backward-compatible with SDR displays:- No metadata required
- Works on SDR displays (degrades gracefully)
- Common in broadcast (BBC, NHK)
- Simpler than HDR10
- Relative (not absolute) brightness
- Slightly lower quality than PQ
- Less common in streaming
Verifying HDR Metadata
After encoding, verify the HDR metadata with ffprobe:color_primaries=bt2020✓ Wide color gamutcolor_transfer=smpte2084✓ PQ (ST.2084)color_space=bt2020nc✓ BT.2020 non-constant luminancecolor_range=tv✓ Limited range (16-235)
HDR Codec Support
Best Codecs for HDR
10-Bit and 12-Bit Encoding
HDR requires higher bit depth to avoid banding:Bit Depth Importance
- 8-bit: 256 levels per channel (SDR)
- 10-bit: 1,024 levels per channel (HDR10 standard)
- 12-bit: 4,096 levels per channel (Dolby Vision)
Platform-Specific HDR Support
macOS (VideoToolbox)
Windows / Linux (NVIDIA NVENC)
Intel QuickSync
Common Issues
Issue: HDR metadata not preserved
Solution: Ensure color space is specified in both encoder config AND per-frame:Issue: Banding in gradients
Cause: 8-bit encoding for HDR content Solution: Use 10-bit codec and increase bitrate:Issue: Colors look washed out
Cause: Incorrect color space or transfer function Solution: Verify color space settings match your source:Best Practices
Use HEVC for HDR
Use HEVC for HDR
HEVC (H.265) provides the best compression and widest HDR support.
Increase bitrate for HDR
Increase bitrate for HDR
HDR needs 25-50% more bitrate than SDR for equivalent quality:
Test on HDR displays
Test on HDR displays
Always verify HDR output on actual HDR displays:
- Apple XDR Display
- HDR TVs
- HDR monitors
Provide SDR fallback
Provide SDR fallback
Not all devices support HDR. Encode both versions: