Skip to content

fix(producer): preserve the output container in segmented capture - #8934

Open
phon-t wants to merge 1 commit into
heygen-com:mainfrom
phon-t:fix/6481-segmented-mov-container
Open

phon-t wants to merge 1 commit into
heygen-com:mainfrom
phon-t:fix/6481-segmented-mov-container

Conversation

@phon-t

@phon-t phon-t commented Nov 26, 2026

Copy link
Copy Markdown

What

Segmented capture always failed with --format mov: every segment was named .mp4, so FFmpeg selected an MP4 container for ProRes and rejected it (Could not find tag for codec prores ... codec not currently supported in container). Segments now take their extension from the already resolved video-only output path, so capture, retry cleanup, resumed segments, and ordered concatenation use the requested container.

The segment plan hash also includes the resolved container extension. A container change invalidates previously encoded segments even when codec and other options stay the same.

Fixes #6481.

How

  • segmentOutputPath takes the container extension instead of hardcoding .mp4.
  • runCaptureSegmentedStage derives it from extname(videoOnlyPath) and threads it through the capture context, run, and concat list.
  • SegmentPlanHashInput gains containerExtension; validateCompletedSegments checks segment paths in the resolved container.

Test plan

  • Unit tests added/updated — new mov/webm witnesses cover capture, retry, manifest and concat in the resolved container, plus a resume witness; the plan hash changes with the container and resume rejects segments when it does.
  • bun test (deliveryEncoder, segmentPlan, captureSegmentedStage): 62 pass / 0 fail. vitest run (segmentManifest): 28 pass / 0 fail.
  • New container tests fail with the extension hardcoded to .mp4 and pass with the fix.
  • bun run --filter @hyperframes/producer typecheck passes; oxlint and oxfmt clean.
  • Manual testing performed — no real --format mov render run; the stage tests drive the same segment paths.

Segmented capture always failed with --format mov: every segment was
named .mp4, so FFmpeg selected an MP4 container for ProRes and rejected
it. Segments now take their extension from the already resolved video-only
output path, so capture, retry cleanup, resumed segments, and ordered
concatenation use the requested container.

The segment plan hash also includes the resolved container extension. A
container change invalidates previously encoded segments even when codec
and other options stay the same.

Fixes heygen-com#6481.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segmented capture always fails with --format mov

1 participant