video_compose: cuts→scenes adapter for CinematicRenderer + dict profile#41
Open
chantskevin wants to merge 1 commit intocalesthio:mainfrom
Open
video_compose: cuts→scenes adapter for CinematicRenderer + dict profile#41chantskevin wants to merge 1 commit intocalesthio:mainfrom
chantskevin wants to merge 1 commit intocalesthio:mainfrom
Conversation
Three small fixes that matter for LLM-driven callers:
1. cuts → scenes adapter for CinematicRenderer
The agent emits edit_decisions.cuts[] with a single consistent
shape across every renderer_family. But the two Remotion compositions
the tool targets read different props:
- Explainer reads props.cuts[] {source, in_seconds, ...}
- CinematicRenderer reads props.scenes[] {src, kind:"video",
startSeconds,
durationSeconds, ...}
When renderer_family=cinematic-trailer / documentary-montage and
props.cuts[] is present without props.scenes[], _remotion_render
now transforms cuts→scenes in place (cumulative startSeconds,
durationSeconds = out-in, in_seconds→trimBeforeSeconds, optional
tone/filter/fade hints preserved).
Without this, Cinematic compositions render 20–30s of pure black
video with no error signal — scenes[] just defaults to [].
2. File-URI rewrite applied to scenes[] too
The existing loop that converts absolute paths to file:// URIs only
ran against cuts[]. After the adapter fires, scene sources need the
same treatment.
3. Accept dict-form profile as well as string name
`profile` is documented as a string key from media_profiles.py
(e.g. "youtube_landscape"), but LLM callers frequently pass
{"width": 1280, "height": 720, "fps": 30}. get_profile(name) then
raises TypeError: unhashable type: 'dict' with no caller recourse.
Accept both: dict → extract width/height directly; string → the
existing get_profile lookup path.
Note on the broader file-path limitation:
Remotion's Chromium refuses `file:///` URLs for local-resource
security ("Not allowed to load local resource"). Callers that pass
absolute local paths still hit this — not regressed by this patch,
just not solved. The long-term fix is serving local files over HTTP
before invoking Remotion. In the meantime, callers with local files
should front them with an HTTP server and pass the URL in cut.source.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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
Three small fixes to
video_compose._remotion_renderfor LLM-driven callers:cuts → scenes adapter for CinematicRenderer — the agent emits a uniform
edit_decisions.cuts[]shape across everyrenderer_family, butCinematicRendererreadsprops.scenes[]with a different field layout.Without this,
renderer_family=cinematic-trailer/documentary-montagesilently renders 20–30s of pure black —
scenesdefaults to[]inRoot.tsx, no error signal.File-URI rewrite applied to
scenes[]too — companion to README video attachment upload #1; theexisting loop only rewrote
cuts[].source.Accept dict-form
profile— schema documentsprofileas a string,but LLM callers frequently pass
{"width": 1280, "height": 720, "fps": 30}.get_profile(name)then crashes withTypeError: unhashable type: 'dict'.Accept both: dict → extract width/height directly; string → existing
lookup.
Notes
Remotion's Chromium still rejects
file:///URLs for local resources.Fix #2 is a code-consistency fix; the broader "serve local files over HTTP"
story is unchanged by this patch.
All three fixes are additive; no behavior change for schema-compliant callers.
Test plan
renderer_family="cinematic-trailer"andcuts[]— produces video (not black)profile={"width": 1280, "height": 720, "fps": 30}— does not crashprofile="youtube_landscape"— existing behavior preserved🤖 Generated with Claude Code