fix(remotion): stage local assets into public/ before Explainer render#328
Open
amitm7 wants to merge 1 commit into
Open
fix(remotion): stage local assets into public/ before Explainer render#328amitm7 wants to merge 1 commit into
amitm7 wants to merge 1 commit into
Conversation
Headless Chromium blocks file:// audio in Remotion renders. Copy local cut sources and narration/music into remotion-composer/public/<slug>/ and rewrite props to staticFile-compatible paths. Mirrors hyperframes_compose staging. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Fixes a production bug in the Remotion render path: local narration and music files fail to load when passed as absolute filesystem paths. Hybrid / real-photo workflows (user photos + local TTS audio) failed unless contributors manually copied assets into
remotion-composer/public/.This PR adds automatic asset staging before
npx remotion render— the same patternhyperframes_composealready uses via_resolve_and_stage_assets, but was missing from the RemotionExplainerpath.Related issue
Refs — (no linked issue; discovered during hybrid real-photo production)
Background (what existed)
video_compose._remotion_renderfile://URIsExplainerresolveAsset()file://; relative →staticFile()underpublic/hyperframes_composepublic/staging for agents, but no tool implemented it for RemotionFailure observed:
Headless Chromium blocks
file://for<Audio>. Manualpublic/copy was the only workaround — undocumented.Gap
file://rewrite incompatible with headless audiovideo_composeWhat we created
lib/remotion_asset_staging.py— copies localcuts[].source,audio.narration.src,audio.music.srcintoremotion-composer/public/<slug>/; rewrites props tostaticFile()paths (<slug>/file.mp3); dedupes shared sources; skips remotehttps://URLsvideo_compose._remotion_render— calls staging before render; removesfile://rewrite; writesmetadata.remotion_asset_stagingreportcompose-director.mddocument the contractChanges
lib/remotion_asset_staging.pytools/video/video_compose.py(_remotion_render)tests/lib/test_remotion_asset_staging.pytests/tools/test_video_compose_remotion_staging.pyskills/pipelines/hybrid/compose-director.mdskills/pipelines/explainer/compose-director.mddocs/contributions/pr-remotion-public-asset-staging.md(full contribution write-up)package-lock.jsonpeer-metadata churnTesting
public/copyArchitecture
docs/PR_REVIEW_GUIDE.mdrender-runtime scenarioChecklist
Made with Cursor