The --hdr flag was silently dropped when combined with --docker because
renderDocker did not include it in the args passed to the in-container
hyperframes render invocation. Forwarding it produces the same HDR10 MP4
(HEVC, yuv420p10le, BT.2020 PQ, mastering display + max-cll) as a local
render — verified end-to-end with the new hdr-pq regression fixture.
This PR also fills in the documentation gaps from the HDR feature stack
(#288, #289, #290, #265, #268), which each added a slice of HDR support
without pulling it together into a single guide.
Code change:
- packages/cli/src/commands/render.ts: refactor renderDocker to use a new
pure helper buildDockerRunArgs (packages/cli/src/utils/dockerRunArgs.ts)
that explicitly threads every render flag — including --hdr, --gpu,
--quiet — into the docker run argv. Snapshot-tested in dockerRunArgs.test.ts
so any future flag drop fails loudly.
Docs:
- New docs/guides/hdr.mdx — top-level HDR guide: quickstart, how detection
works, source media requirements (HDR video + 16-bit HDR PNG), output
format constraints, ffprobe verification, Docker rendering, limitations,
common pitfalls
- docs/guides/common-mistakes.mdx — "Expected HDR but got SDR" entry; --hdr
is detection, not force; notes Docker now supports it
- docs/guides/rendering.mdx — --hdr row in flags table; HDR card under
Next Steps
- docs/packages/cli.mdx — expanded --hdr description with link to the guide
- docs/packages/producer.mdx — HDR Output section under RenderConfig
- docs/packages/engine.mdx — HDR APIs section (color-space utilities +
WebGPU readback runtime); now compiles because DEFAULT_HDR10_MASTERING
and HdrMasteringMetadata are re-exported from packages/engine/src/index.ts
- docs/docs.json — register the new HDR guide in nav
Review feedback from PR #346:
- packages/engine/src/index.ts — export DEFAULT_HDR10_MASTERING and
HdrMasteringMetadata so the engine docs example compiles
- docs/guides/hdr.mdx — drop fabricated "animated HDR images log a warning
and use first frame" claim (not implemented); clarify that HDR <img> is
16-bit PNG only and other formats fall back to SDR; broaden the yt-dlp
example to bestvideo[dynamic_range=HDR]+bestaudio so AV1-HDR streams
are also picked up; qualify the Docker render benchmark claim
- packages/producer/src/services/renderOrchestrator.ts — bump the HDR + non-mp4
fallback from log.info to log.warn and make the message actionable
Regression test (hdr-pq):
- packages/producer/tests/hdr-regression — delete the broken sub-tree.
The old hdr-pq composition relied on a CDN shader-transitions library
and window.__hf injection with scenes defaulting to opacity:0, so when
the library failed to load most of the render was invisible. The fixture
was also nested two directories deep, so discoverTestSuites (which only
scans direct children of tests/) never picked it up.
- packages/producer/tests/hdr-pq — new top-level fixture: 5s of an HDR10
HEVC Main10 BT.2020 PQ source clip with a static SDR DOM overlay. Source
is a 5s excerpt (1:18–1:23) from https://youtu.be/56hEFqjKG0s, downloaded
via yt-dlp and re-encoded to HEVC Main10 / 1920x1080 / 30fps with HDR10
mastering metadata. Self-contained: no external CDNs, no custom fonts,
no animation libraries. NOTICE.md captures attribution.
- packages/producer/src/regression-harness.ts — add optional hdr boolean
to TestMetadata.renderConfig, validate it, and forward it to
createRenderJob so HDR fixtures actually run through the HDR pipeline.
- .github/workflows/regression.yml — exclude hdr from the fast shard and
add a dedicated hdr shard so the new fixture runs on CI.
- .gitattributes — LFS-track packages/producer/tests/*/src/*.mp4 so source
clips don't bloat the repo.
- packages/engine/src/services/frameCapture.ts — inject a no-op __name
shim into every page via evaluateOnNewDocument. tsx transforms the
engine source on the fly with esbuild's keepNames, which wraps every
named function in __name(fn, "name"). When page.evaluate() serializes
a callback those calls would crash with "__name is not defined" because
the helper only exists in Node. The shim makes the engine work whether
it's imported from compiled dist or from source via tsx.
- Engine: document getEncoderPreset() for MP4/WebM, VP9 alpha flags,
Opus audio in mux step
- Producer: document format field in RenderConfig, WebM usage example,
pipeline steps updated for WebM
- CLI: add render command examples in --help (including WebM overlay)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Major improvements across all 18 pages:
- Use Mintlify components: <Steps> for tutorials, <Tabs> for alternatives,
<CodeGroup> for multi-platform commands, <Tree> for directory structures,
<AccordionGroup> for FAQ/scannable content, <Mermaid> for diagrams
- Add filename annotations to all code blocks (e.g., ```html index.html)
- Add numbered comments inside multi-step code examples
- Show expected terminal output after CLI commands
- Add "When to use" / "When NOT to use" sections to all package pages
- Add "Next Steps" CardGroup to every page (no dead-end pages)
- Cross-link between pages at point of curiosity (not just "see also" dumps)
- Expand thin pages (engine, studio) with architecture details and examples
- Add decision guides (rendering modes, template selection)
- Use <Warning> and <Note> sparingly (max 2-3 per page)
Also adds DOCS_GUIDELINES.md at repo root with writing standards.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>