Repository navigation
fix(ffmpeg): stop multi-threaded exports from hanging at 100% - #1831
Merged
Merged
Conversation
Production (Netlify) is cross-origin isolated, so every browser loads the multi-threaded core. With FFmpeg choosing its own thread count, core-mt's 32-worker pool deadlocks and every export sits at "Exporting 100%" forever. Reproduced locally with COOP/COEP for MP4, WebM, portrait and no-audio inputs; the single-threaded core was unaffected. Ports the export hardening from the earlier branch (33b2c5a, bf26cf1): - src/lib/ffmpegArgs.ts: one command builder used by the worker (the old copy in ffmpeg.ts was dead code); decoder, filter and encoder threads capped at 4 on the multi-threaded core only - stall watchdog with worker heartbeats: 60 s without activity fails the export with ExportStalledError, and later attempts use the single-threaded core - WebM uses VP8 + Vorbis: libvpx-vp9 and libopus trap in @ffmpeg/core 0.12.10 - SRI hashes for the multi-threaded core files; falls back to the single-threaded core if core-mt fails to load - id-less worker errors, cancel during engine load, and string rejections from wasm traps no longer leave the editor stuck Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for reframe-os ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
👋 Thanks for your PR, @magic-peach!Welcome to Reframe — a browser-based video editor built for everyone 🎬 What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
Contributor
|
…read default 2 - Threads per stage are min(4, navigator.hardwareConcurrency || 2); the fallback for an unreported core count was 4. - When the multi-threaded engine stalls, exportVideo retries the same export (same file and edits) once on the single-threaded engine instead of failing. The overlay says so, and RUM gets engine_fallback with the stall reason; the attempt's single outcome then carries engine "single" and fell_back. - A single-threaded stall, or a stall after cancelling, is not retried; the error tells the user to press Retry. - The editor passes the duration it already read to the export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are untracked local copies (names ending in " 2"), not project files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 3, 2026
magic-peach
marked this pull request as ready for review
November 3, 2026 15:56
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
magic-peach
added a commit
that referenced
this pull request
Nov 3, 2026
No content change: this branch already contains #1831's commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
magic-peach
added a commit
that referenced
this pull request
Nov 3, 2026
No content change: main's tree equals 8e24b37, which this branch builds on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production exports are hanging
https://reframe-os.netlify.app is cross-origin isolated, so every browser loads the multi-threaded FFmpeg core. On
main, FFmpeg chooses its own thread count, core-mt's 32-worker pool deadlocks, and every export sits at "Exporting 100%" forever. Datadog has no successful production export since 2026-10-22.Reproduced locally with Playwright (headless Chromium, production build served with COOP/COEP):
main, isolatedmain, not isolatedWhat changes
Ports the export hardening from the earlier branch (commits 33b2c5a and bf26cf1). These files hadn't changed on
mainsince then except for #1829's telemetry, which this keeps.src/lib/ffmpegArgs.ts: one command builder, used by the worker. The copy inffmpeg.tswas dead code, and the worker's own copy ignored sharpness and volume.ExportStalledError(telemetry categorytimeout), and later attempts in the page use the single-threaded core.Changes after review (3fe0335, 29db120)
min(4, navigator.hardwareConcurrency || 2). Before, an unreported core count meant 4.engine_fallbackwithstall_reason. The attempt's one outcome then hasengine: singleandfell_back: true.main's history.Checks
bun run test: 29 files, 338 tests pass. They include the fallback (retried with the same edits, not retried when single-threaded or cancelled) and thread-count tests.Follow-up (stacked PR, Phase 1 of the plan)
Infinitydurations as unknown everywhere.outputDurationArgsstill letsInfinitythrough when speed ≠ 1.unknown_durationfailure category.