Skip to content

fix(studio-server): a video with a codec nobody listed gets a playable preview copy - #7356

Merged
miguel-heygen merged 2 commits into
mainfrom
drenderq/hostile-unknown-codecs
Nov 7, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
drenderq/hostile-unknown-codecs

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

A video whose codec the preview server has no entry for now counts as browser-hostile and gets a playable preview copy, unless its codec is on a short list browsers decode everywhere (H.264 and VP8). Before, the table listed the codecs to convert and everything else was assumed to play, so a file with a codec nobody had listed showed a blank tile until someone added its name. VP9 and AV1 keep their existing entries: copied only when a browser asks.

Why

Each blank-tile report so far (MPEG-4, MJPEG, MPEG-2, DNxHD) was the same missing line. The rule now fails safe: an unknown codec costs one background transcode, never a blank preview. Publishing bakes a proxy for an unlisted codec too, as it does for the listed ones; that is intended.

What I measured

fails without the fix: packages/studio-server/src/helpers/mediaCodecMap.test.ts "treats a codec nobody listed as browser-hostile, so its file gets a playable copy" and "reads a codec named after an Object.prototype key as an unlisted codec" (both red on main, green here; run on Linux).

  • H.264, VP8, VP9 and AV1 still get no pre-warmed copy (tested).
  • The whole studio-server suite: 90 files, 1632 tests passed. The comment ratchet and the format check pass.

What I did NOT exercise

  • A real browser playing a copy of a codec outside the existing table; the copy path is the one MPEG-2 and DNxHD already use.
  • The CLI and other callers of the codec table: they read browserHostile and shouldPrewarmProxy, so they follow the new rule; only studio-server's tests ran.

Size

About 50 changed lines in 2 files: one rule inverted in one function and its tests. Nothing else can carry it.

Size: a lone urgent fix. Paying people see blank video cards for codecs nobody listed, and no open PR in this area can carry it.

@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 60e2cab0

  • blocker: the PR body has no fails without the fix: line naming a test that fails on main. This lane requires one on every fix PR. The body is only a ## Size section. Add the line (for example, fails without the fix: treats a codec nobody listed as browser-hostile, so its file gets a playable copy) along with a short what/why. That is the only blocker.

The code itself looks right to me. Inverting hostileCodecEntry to an allowlist (h264, vp8, plus the MIME-checked vp9/av1) keeps the Object.hasOwn guard. The probe cache is in memory and keyed by mtime, so stale facts don't outlive the process. One side effect to confirm is intended: publishProxyBake (cli/src/utils/publishProxyBake.ts:97) will now bake proxies for unlisted codecs at publish.

Scope

Read the diff, hostileCodecEntry and its callers (codecFactsFor, shouldPrewarmProxy), scanProjectMedia, the probe cache, and the runtime consumers of browserHostile. CI CI/CodeQL/Windows render verification were still running at review time.

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Added the 'fails without the fix:' line and the what/why to the body (the first body write had lost them). Yes, the publish bake now also covers unlisted codecs; that is intended and stated in the body.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 110 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 (8)

Unstable (1)

  • seqplainkeys-none-pct-r0-nested-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@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 · 60e2cab0 → 60e2cab0 (body-only change). The fails without the fix: line names two tests; both assert browserHostile: true for an unlisted codec, where main returns false, so both fail on main. The publish-bake side effect is stated as intended.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit cf75dfd Nov 7, 2026
173 of 175 checks passed
@miguel-heygen
miguel-heygen deleted the drenderq/hostile-unknown-codecs branch November 7, 2026 09:10
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