mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
When a composition contains both HDR (bt2020) and SDR (bt709) video elements, the SDR content appears washed out because Chrome clamps HDR frames to sRGB during rendering. This adds automatic color space detection and normalization during the video frame extraction phase — if any video is HDR, all SDR videos are converted to HLG/BT.2020 (npl=600) via zscale before frame extraction. - Add colorSpace (transfer, primaries, matrix) to VideoMetadata via ffprobe - Add isHdrColorSpace() to detect bt2020/PQ/HLG content - Add convertSdrToHdr() using zscale with 600 nit nominal peak luminance - Restructure extractAllVideoFrames into 3 phases: resolve, normalize, extract - 6 new unit tests for HDR detection across all color space variants Same approach as HeyGen Rio's pipeline (heygen_rio.py#L568-585). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>