HDR Video Analyzer is a high-performance Python tool designed to analyze brightness (Nits) and color gamut coverage (Rec.709 / P3 / Rec.2020) and APL% of HDR video files.
- Python 3.x
- FFmpeg (Must be installed and added to your system
PATH). - Python Libraries:
(Tkinter is usually included with Python)
pip install numpy matplotlib
- Run the script:
python HDR_Analyzer_Pro_v9.py
- Select Mode:
- Analyze New Video: Choose a 4K HDR video file (MKV, MP4, TS).
- Plot from CSV: Select a previously generated
.csvto re-draw charts.
- Configure Settings:
- Sampling Interval: Choose between Frame-by-frame (Slowest), 1s/sample, or 2s/sample.
- Subsampling:
Yes: Fast mode (Recommended). Physical pixel skipping. No interpolation artifacts.No: Full pixel analysis.
- Result:
- A
.csvfile containing timestamped Nits and Gamut data. - A
.pngchart visualizing the analysis.
- A
The tool generates a CSV and a Chart with two sections:
-
Brightness (Top Chart):
- Peak Nits: The maximum brightness of the brightest pixel in the frame (or sampled area).
- Avg Nits: The average brightness of the entire 16:9 frame (including black bars).
- Axis is plotted in PQ space but labeled in Nits.
-
Gamut Ratio (Bottom Chart):
- Rec.709 / Dark: Pixels that are either dark (< 1.0 nits), low confidence, or within the standard Rec.709 triangle.
- P3: Pixels that exceed Rec.709 but fall within DCI-P3.
- Rec.2020: Pixels that exceed DCI-P3 boundaries.
Averages calculated on cropped frames (e.g., 3840x1600) are artificially inflated. By padding to 3840x2160, this tool provides standardized metrics comparable across different aspect ratios.
Dark scenes in HDR often contain sensor noise. A simple brightness threshold isn't enough. This tool applies a secondary check on the total XYZ energy. If a pixel is "bright" but has extremely low chromatic energy, it is treated as noise (Rec.709) rather than false high-saturation color.
This project is licensed under the MIT License - see the LICENSE file for details.