From e4b1832fadd4c063bcf9a19cd351684815fbc23e Mon Sep 17 00:00:00 2001 From: Aditya Poudyal Date: Wed, 16 Sep 2026 18:09:14 -0700 Subject: [PATCH] feat(cli): add hls output format (#4022) --- docs/guides/rendering.mdx | 23 +++++ docs/packages/cli.mdx | 6 +- docs/packages/producer.mdx | 22 +++++ packages/cli/src/commands/render.test.ts | 38 ++++++++ packages/cli/src/commands/render.ts | 92 ++++++++++++++----- packages/cli/src/commands/render/execute.ts | 2 + packages/cli/src/commands/render/plan.test.ts | 39 +++++++- packages/cli/src/commands/render/plan.ts | 40 +++++++- packages/cli/src/commands/render/present.ts | 23 +++-- packages/cli/src/ui/format.test.ts | 11 +++ packages/cli/src/ui/format.ts | 19 ++-- packages/cli/src/utils/dockerRunArgs.test.ts | 18 ++++ packages/cli/src/utils/dockerRunArgs.ts | 6 +- packages/cli/src/utils/renderArgs.test.ts | 18 ++++ packages/cli/src/utils/renderArgs.ts | 28 ++++++ packages/producer/README.md | 60 +++++++++--- skills-manifest.json | 2 +- .../references/preview-render.md | 51 +++++----- 18 files changed, 413 insertions(+), 85 deletions(-) diff --git a/docs/guides/rendering.mdx b/docs/guides/rendering.mdx index 8a96bdf74a..ef7fe661b0 100644 --- a/docs/guides/rendering.mdx +++ b/docs/guides/rendering.mdx @@ -46,6 +46,7 @@ npx hyperframes render --output final.mp4 | WebM | Web delivery and transparent overlays | | GIF | Short previews in issues, pull requests, and documentation | | PNG sequence | Frame-by-frame handoff to compositing software | +| HLS | VOD streaming from a playlist directory | Examples: @@ -61,6 +62,9 @@ npx hyperframes render --format gif --fps 15 --output preview.gif # RGBA frames in a directory npx hyperframes render --format png-sequence --output frames + +# HLS VOD stream in a directory +npx hyperframes render --format hls --output stream ``` GIF has no audio and limited transparency. Prefer MP4 or WebM for normal playback. @@ -94,6 +98,25 @@ View the PNG over a checkerboard or contrasting background. If it is still opaque, compare it with the composition's PNG-sequence output to check whether transparency was already missing before video encoding. +### HLS streaming output + +`--format hls` writes an HLS VOD stream into the output **directory**: +`master.m3u8`, `video.m3u8` and `video_NNNNN.ts`, plus `audio.m3u8` and +`audio_NNNNN.ts` when the composition has audio. The video and audio encodes +are identical to MP4; only the delivery container differs, and packaging is a +stream copy rather than a second encode. + +```bash +npx hyperframes render --format hls --output stream +npx hyperframes render --format hls --hls-segment-seconds 6 --output stream +``` + +Segments are exactly `--hls-segment-seconds` long (default 4) except the last, +and every segment starts on a keyframe. HLS output is SDR only, so `--hdr` is +rejected, and `--gpu` is rejected because GPU encoders ignore the forced-keyframe +lock that fixed-length segments depend on. Cloud rendering (`lambda`, +`cloudrun`) does not offer HLS yet. + ## Input video codecs Studio, preview, `check`, and published projects normally create cached browser diff --git a/docs/packages/cli.mdx b/docs/packages/cli.mdx index e0b4141a3a..27dd703d2b 100644 --- a/docs/packages/cli.mdx +++ b/docs/packages/cli.mdx @@ -845,6 +845,9 @@ npx hyperframes render --docker --output output.mp4 # Transparent, for overlays and lower thirds npx hyperframes render --format webm --output overlay.webm +# HLS VOD stream (output is a directory of playlists and .ts segments) +npx hyperframes render --format hls --output stream + npx hyperframes render --output output.mp4 --fps 60 --quality high npx hyperframes render --gpu --output gpu.mp4 ``` @@ -855,7 +858,7 @@ The flags that come up most: | ------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `--output, -o` | `renders/.mp4` | Output file path | | `--composition, -c` | `index.html` | Render a different composition file. Sub-compositions using `