Skip to content

fix(producer): a failed video extraction names which clip files failed - #6905

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/extraction-error-names-source
Nov 1, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/extraction-error-names-source

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

When video extraction fails, the error now names the failed clip files, project-relative: Video extraction failed for 2 source(s) [VIDEO_SOURCE_UNRENDERABLE; invalid_media=2] (assets/a.mp4, assets/b.mp4). Up to five names, then and N more.

Why

An export with many video clips failed with Video extraction failed for 1 source(s) [VIDEO_SOURCE_UNRENDERABLE; invalid_media=1] and nothing said which of the clips it was, so the author had to bisect the project by hand.

How

  • The engine labels each failure with its clip's source at the one place the result is assembled (extractAllVideoFrames): a project-relative path, or for a remote source only its file name (no host, query or fragment), or the file name for a path outside the project.
  • VideoExtractionStageError appends the sorted, de-duplicated names to its message. The code, the kind counts and publicMetadata are unchanged, so nothing that parses them moves.
  • A failure from the HDR probe path carries no clip id, so its message is unchanged.

Test plan

fails without the fix: packages/producer/src/services/render/stages/extractVideosStage.test.ts › assertVideoExtractionSucceeded › names the failed clips, at most five, in the message and nowhere else

  • extractAllVideoFrames on a missing local file reports source: "assets/missing.mp4".
  • The label never prints a host, query, signature or absolute path.
  • videoFrameExtractor.test.ts and extractVideosStage.test.ts: 253 passed, 3 runs in a row. Against main, 3 of the new tests fail (no source, message without names).
  • oxlint 0 errors.
  • Committed with lint/format/typecheck hooks skipped locally (no node_modules on the Mac); oxlint and the tests were run on a remote box.

Size

Under 100 lines, but it stands alone: it changes one engine result type and the one error that reads it; splitting would leave either an unused field or a message with nothing to print.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 8f2d1d17

The fails without the fix: line names a real test. The blocker is that videoExtractionSourceLabel can still print an absolute path, or a whole inline payload, into the message (see the inline comment).

Scope

Read all 4 files at head, plus resolveProjectRelativeSrc/cleanAssetUrl in parsers and resolveMediaElementSrc. Ran the label logic locally on non-http schemes. CI was still running when I reviewed, so this verdict is on the code only.

return "remote video";
}
}
const path = src.split(/[?#]/)[0]!;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocker: any non-http scheme falls through to normalize() and is printed as-is. That breaks the "no host, query, fragment or absolute path" promise in the docstring and the PR body. Locally, with baseDir /proj:

  • file:///Users/me/private/a.mp4 → file:/Users/me/private/a.mp4 (absolute path and username). The engine doesn't resolve file:// srcs, so this src always fails and always reaches the message.
  • data:video/mp4;base64,AAAA… → the whole base64 payload. resolveMediaElementSrc passes data: srcs through, so an inlined clip puts megabytes into error.message and the logs.
  • HTTPS://cdn/x.mp4 (upper case) → HTTPS:/cdn/x.mp4 (host), because isHttpUrl is case-sensitive.

Suggested fix: before the local branch, handle any ^[a-z][a-z0-9+.-]+: scheme (two or more characters, so C:\ drive paths still count as local). data:/blob: → a fixed label such as inline video; any other scheme → basename(new URL(src).pathname), with the existing remote video fallback. Match http case-insensitively too. Then add file:, data: and upper-case HTTPS: cases to the label test.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 124 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (1)

  • seqplainkeys-none-center-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@miguel-heygen
miguel-heygen force-pushed the fix/extraction-error-names-source branch from 8f2d1d1 to 7fe07b6 Compare October 31, 2026 22:56

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE — 1 resolved, 0 open, 0 new · 8f2d1d17 → 7fe07b68 (rebased onto main). data:/blob: srcs now print inline video. Any other scheme, at any case, prints only its file name, and drive and UNC paths go through win32. The new label test covers file:, data:, blob:, ftp:, upper-case HTTPS: and both Windows cases.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 1, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 32de019 Nov 1, 2026
90 checks passed
@miguel-heygen
miguel-heygen deleted the fix/extraction-error-names-source branch November 1, 2026 00:25
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.

1 participant