Repository navigation
fix(export): block browser fast export when video layers overlap on Windows - #227
Open
changqingdata wants to merge 1 commit into
Open
changqingdata wants to merge 1 commit into
changqingdata wants to merge 1 commit into
Conversation
…indows Several video layers that overlap in time share Remotion's OffthreadVideo compositor and frame cache. On Windows the WebCodecs decoder stalls when more than one of them requests frames: the fast export neither advances nor reports an error, so the user can only cancel it. browserTimelineBlocker() was a stub that always returned null, so nothing stopped the browser path for those timelines. It now sweeps the clip intervals of the timeline (nested sequences included) and, when a Windows browser would run two or more video sources on the same frame, returns an explicit reason so the export falls back to the local renderer instead of hanging. The platform is a parameter with a browser-derived default, so the verify script drives the Windows, other-platform and empty-timeline cases without a DOM. Verification: npx tsc -b, npm run lint, src/export/browserExport.verify.ts
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.
Problem
On Windows, a timeline whose video layers overlap in time hangs the browser fast export (WebCodecs): the progress stops at some percentage and never reports an error, so the only way out is to cancel it manually.
Reproduction
Cause
browserTimelineBlocker()is a stub that always returnsnull, so nothing rejects the browser path for a timeline with several video sources. Multiple OffthreadVideo layers then request frames from the WebCodecs decoder at the same time, and on Windows that decoder stalls.Change
hasOverlappingVideoSources(): sweeps the clip intervals of the timeline, nested sequences included, and reports whether two or more video sources are live on the same frame.browserTimelineBlocker()now returns an explicit reason when the browser is Windows and such an overlap exists, so the export falls back to the local renderer. The server render path is untouched.Verification
src/export/browserExport.verify.ts: single track is not blocked, overlapping tracks are blocked, nested sequence overlap is blocked, non-Windows is not blockednpx tsc -bandnpm run lintpass locallyThis only rejects the fast path on the configurations that hang; the render itself is unchanged.