Skip to content

fix(studio-server): MPEG-2 and DNxHD videos get a playable preview copy - #7348

Merged
miguel-heygen merged 1 commit into
mainfrom
drenderq/hostile-mpeg2-dnxhd
Nov 7, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
drenderq/hostile-mpeg2-dnxhd

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What changed

BROWSER_HOSTILE_CODECS gains mpeg2video (MPEG-2, as in an mp4 from an older camera or encoder) and dnxhd (Avid DNxHD in a mov), both with no representative mime and pre-warm on, as prores and mpeg4 are. A project video in either codec now gets a browser-playable copy instead of "no copy" (browser_safe_codec).

Why

Chrome in Electron refuses both: a card for an ffmpeg -c:v mpeg2video mp4 and a -c:v dnxhd mov ended with <video> error code 4 and no picture, while the same studio server table lists neither, so the copy request was answered 404. In the same run H.264 (4:2:0, 4:4:4 and 4:2:2 10-bit), HEVC, VP9 and AV1 played, and MPEG-4 and ProRes played through their copy.

What I measured

  • fails without the fix: packages/studio-server/src/helpers/mediaCodecMap.test.ts, 4 failures with the two table lines removed (the mpeg2video and dnxhd mime and pre-warm cases), 45 pass with them (bun, vitest, format check on a Linux box).
  • Browser check: one Chrome inside Electron on macOS, one generated clip per codec.

What I did NOT exercise

  • No end-to-end proxy transcode of an mpeg2video or dnxhd file through the server route; the table is what decides eligibility.
  • Other codecs (h263, msmpeg4, vc1, wmv, dv) are not added: they could not be put in an mp4 here, or were not tried.

Size

About 4 changed lines in 2 files: a lone table change with its test; nothing open on this table to 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.

Approve at 66d82ed5.

The change adds two lines to the table, matching the existing mpeg4/mjpeg/prores pattern: no representative mime, and pre-warm on. That's right for codecs that no browser decodes.

Verified at this head:

  • npx vitest run src/helpers/mediaCodecMap.test.ts: 45 passed.
  • fails without the fix: holds. With main's mediaCodecMap.ts, the 4 new cases fail (mime and pre-warm, for mpeg2video and dnxhd).
  • The keys match ffprobe's names. Clips generated with -c:v mpeg2video (mp4) and -c:v dnxhd (mov) probe as mpeg2video and dnxhd.
  • This table is the only codec list. Its consumers (checkBrowser, publishProxyBake, the preview route, staticProjectServer) all go through hostileCodecEntry/decideMediaProxyEligibility, so check copies and publish bakes pick both codecs up consistently.

Non-blocking: MPEG-2 from broadcast or older cameras is often interlaced. The proxy transcode doesn't deinterlace, so such a copy may show combing on motion. Worth a follow-up if anyone reports it.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

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

  • seqrepeat-none-center-r0-nested-z100: 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 / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 6004508 Nov 7, 2026
82 checks passed
@miguel-heygen
miguel-heygen deleted the drenderq/hostile-mpeg2-dnxhd branch November 7, 2026 05:05
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 7, 2026
…-com#7336-heygen-com#7358

Adopt heygen-com#7304 (without CLI renderDiagnostic, needs heygen-com#6725), heygen-com#7331, heygen-com#7332, heygen-com#7334,
heygen-com#7337, heygen-com#7336, heygen-com#7339, heygen-com#7289, heygen-com#5594, heygen-com#6900, heygen-com#7322, heygen-com#7342, heygen-com#7343, heygen-com#7350 (onProgress
only), heygen-com#7352, heygen-com#7348, heygen-com#7344, heygen-com#7353, heygen-com#7356 and heygen-com#7355. Defer heygen-com#5708 (needs heygen-com#6911) and
heygen-com#7345 (READ_VERSION 4 vs 7); heygen-com#7307 not applicable. Re-read 14 moved pins, pin 6
new PRs (monitored 126). Make checkReportFile module-private and suppress the
cross-package closeTestChrome duplicate for fallow.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-authored-by: SophiaHuangCc <129631224+SophiaHuangCc@users.noreply.github.com>
Co-authored-by: Dante <duanjl.china@gmail.com>
Co-authored-by: Muzzy5150 <muzzy5150yt@gmail.com>
Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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