Skip to content

fix(studio-server): a failed preview copy reports its causes and what its source is - #6350

Open
miguel-heygen wants to merge 3 commits into
mainfrom
checklong/proxy-odd-names
Open

miguel-heygen wants to merge 3 commits into
mainfrom
checklong/proxy-odd-names

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

When a preview copy fails, the error (shown by check --json, snapshot, preview and publish) now carries:

  • up to the last three real ffmpeg error lines, not just the last one, with absolute paths replaced by <path>. The line before ffmpeg's Error opening output file names why the output could not open (it often does not look like an error, so it was dropped before).
  • what the source is, with no name or folder: kind, codec, pixel format, transfer, audio or not, every stream as type:codec[flags] (so a disabled, still or data track shows), duration, size in MB, and where it lives: icloud, cloud-storage (Dropbox, OneDrive, Google Drive, Library/CloudStorage), external-volume or local.

Before: ffmpeg exited with code 234: Error opening output files: Invalid argument.
After, for a source ffmpeg can copy nothing from: ffmpeg exited with code 234: [out#0/mp4 @ …] Output file does not contain any stream; Error opening output files: Invalid argument (source: video, hevc, no audio, streams video:hevc[default] data:?[], 12s, 48 MB, icloud).

Why

A phone recording's preview copy failed with only the generic line, the reports are anonymous (no file, no folder, no way to ask), so the cause could not be found. The report has to carry it.

What I checked for the original report

Not reproduced; the report now explains itself next time. With the same ffmpeg Desktop ships (8.1.2) and the proxy's exact encode arguments, in a folder named with spaces, a colon and unicode, these all copy fine: H.264, HEVC 10-bit, HLG tone-mapped, a Dolby Vision configuration record, 90-degree rotation, an extra data stream, odd dimensions, an audio-only file, and a MOV whose tracks are all marked disabled. The output file name is a hash, so the source name never reaches ffmpeg's output argument. Exit 234 reproduces only when ffmpeg has nothing to write.

Tests

  • failure message ends with the source description and leaves out the file name and the project path (fails without the change);
  • ffmpeg's real stderr shape, Output file does not contain any stream before Error opening output files (fails without the change);
  • stream summary with flags from the probe; folder kind for iCloud, Library/CloudStorage, Dropbox, OneDrive, /Volumes, and a plain folder.
    73 tests in the two files pass, 3 runs in a row; lint and format clean.

@miguel-heygen miguel-heygen changed the title fix(studio-server): a failed preview copy says why its output could not open fix(studio-server): a failed preview copy reports its causes and what its source is Oct 25, 2026

@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 · 2 blockers · 1 important · 0 nits · head 25380b9b

  • blocker: The Comments workflow fails on this head (run 40235380055). comment-ratchet reports that mediaMetadata.ts's comment share went up (16/271 vs 15/256), coming from the new doc comment on MediaMetadata.streams (mediaMetadata.ts:80). Drop the comment, or move what it says into the type.
Scope

Read the full diff of proxyTranscoder.ts and mediaMetadata.ts, plus the new tests. Ran the ABSOLUTE_PATH regex and statSync on a missing path in node to confirm the two inline findings. The main CI run was still in progress. No earlier reviews.

— Claude (Genesis)

Comment thread packages/studio-server/src/helpers/proxyTranscoder.ts Outdated
Comment thread packages/studio-server/src/helpers/proxyTranscoder.ts
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Fallow audit report

Quality gate failed

Found 1 finding.

Health (1)
Severity Rule Location Description
major fallow/high-cognitive-complexity packages/studio-server/src/helpers/mediaMetadata.ts:205 'probeMediaMetadata' has cognitive complexity 16 (threshold: 15)

Generated by fallow.

Gate outcomes: failed audit-verdict.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy did not run: 0 of 5 shards reported results; see the shard jobs.

Nothing was compared with the base branch.

@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 — 3 resolved, 0 open, 1 new · 25380b9 → e20e72e

  • blocker: Fallow audit fails on this head (CI run 40238901213) with fallow/high-cognitive-complexity: probeMediaMetadata (mediaMetadata.ts:205) is at 16, threshold 15. The new (parsed.streams ?? []).slice(…).map(summarizeStream) pushes it over. Moving it into a helper, e.g. streams: summarizeStreams(parsed.streams), should bring it back under.

— Claude (Genesis)

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.

1 participant