feat(engine): add HDR video output pipeline#265
Open
vanceingalls wants to merge 4 commits intomainfrom
Open
Conversation
85de722 to
0b70603
Compare
bc461a1 to
4923ab0
Compare
Collaborator
Author
This was referenced Apr 16, 2026
1a45995 to
ffc3b12
Compare
…ut colors 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>
Auto-detect HDR sources via ffprobe, switch to H.265 10-bit with BT.2020/HLG metadata. HLG pass-through (no conversion), hvc1 codec tag for Apple playback, 1-hour streaming timeout for HDR. WebGPU float16 readback pipeline implemented and tested but gated behind headed Chrome. HDR utilities with 15 unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Node streams hold a reference to the provided buffer and drain it asynchronously. Without copying, callers that reuse buffers get partially-overwritten data in the pipe. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4b58dc9 to
837402d
Compare
4923ab0 to
686e45d
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds the ability to render HDR video output (H.265 10-bit, BT.2020) from HyperFrames compositions. When the renderer detects HDR source video, it automatically switches to the HDR output pipeline — no flags needed.
What it does
ffprobe. If any has bt2020/PQ/HLG color metadata, the output switches to H.265 10-bit with correct color tags. SDR-only compositions are unaffected (H.264, bt709).libx265,yuv420p10le, BT.2020 color primaries,hvc1codec tag (required for Apple playback).detectTransfer()(PQ vs HLG),getHdrEncoderColorParams(),analyzeCompositionHdr(). 15 unit tests.Key design decisions
--hdrflaghvc1codec taghvc1(nothev1) for HEVC playback.Files changed
packages/engine/src/utils/hdr.tspackages/engine/src/services/hdrCapture.tspackages/engine/src/services/streamingEncoder.tspackages/engine/src/services/chunkEncoder.tspackages/producer/src/services/renderOrchestrator.tsHow to test
Render a composition with an HDR video source. The output should be H.265 10-bit with HDR metadata visible in
ffprobe(bt2020, arib-std-b67 or smpte2084). Plays correctly in QuickTime and on HDR displays.Stack position
2 of 6 — Stacked on #258 (SDR/HDR normalization). Provides the encoder infrastructure that phases 1-5 build on.
🤖 Generated with Claude Code