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>
chantskevin
added a commit
to chantskevin/OpenMontage
that referenced
this pull request
Apr 24, 2026
The matrix-full caught two bugs the first time it actually ran: ### Bug 1: Remotion couldn't load testsrc sources The cuts→scenes adapter (calesthio#41 / cherry-pick ef16bba) converts cuts[].source from absolute paths to file:// URIs for Remotion. Remotion's Chromium then proxies file:// requests through its local dev server at /public/<path>. Since the bundle's public/ dir doesn't contain the test source, every Remotion render returned 404 → render exited non-zero. Fix: cherry-picked d820d3b (serve Remotion assets via --public-dir) and da218ed (harden public-dir selection + regression test). Both are upstream-quality bug fixes that lived on the snapshot branch but weren't yet on main. With them, the bundle server's --public-dir is set to the directory containing the assets, so file:// URIs resolve correctly via the http://localhost:3000/public/<rel-path> proxy. The audit doc had categorized these as Bucket 2 (BOS-integration artifacts) but they're actually Bucket 1 (real upstream bugs) — needed by ANY caller using local files with Remotion. The matrix test surfaced this. ### Bug 2: test cell built ID-shaped sources for low-level entry operation="render" / "compose" are high-level orchestrators that take asset_manifest and resolve cuts[].source IDs internally. operation="remotion_render" is the LOW-LEVEL direct entry — it expects cuts with pre-resolved file paths and ignores asset_manifest. The matrix's `_build_inputs` was building ID-shaped sources for ALL cells. The cinematic-trailer__remotion-render cell hit Remotion with `source: "a0"` literally, which proxied to `/public/a0` and 404'd. Fix: `_build_inputs` now builds operation-appropriate inputs. remotion_render cells get literal paths in cuts[].source and no asset_manifest. render/compose cells continue to get IDs + manifest. This also documents the contract: each operation's expected input shape lives in the cell-builder. If a future operation expects something different, this is the obvious place to add it. ### Result 12/12 cells pass in 32s, well under the 10-min nightly budget. The full matrix is now a real safety net. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chantskevin
added a commit
to chantskevin/OpenMontage
that referenced
this pull request
Apr 24, 2026
The matrix-full caught two bugs the first time it actually ran: ### Bug 1: Remotion couldn't load testsrc sources The cuts→scenes adapter (calesthio#41 / cherry-pick ef16bba) converts cuts[].source from absolute paths to file:// URIs for Remotion. Remotion's Chromium then proxies file:// requests through its local dev server at /public/<path>. Since the bundle's public/ dir doesn't contain the test source, every Remotion render returned 404 → render exited non-zero. Fix: cherry-picked d820d3b (serve Remotion assets via --public-dir) and da218ed (harden public-dir selection + regression test). Both are upstream-quality bug fixes that lived on the snapshot branch but weren't yet on main. With them, the bundle server's --public-dir is set to the directory containing the assets, so file:// URIs resolve correctly via the http://localhost:3000/public/<rel-path> proxy. The audit doc had categorized these as Bucket 2 (BOS-integration artifacts) but they're actually Bucket 1 (real upstream bugs) — needed by ANY caller using local files with Remotion. The matrix test surfaced this. ### Bug 2: test cell built ID-shaped sources for low-level entry operation="render" / "compose" are high-level orchestrators that take asset_manifest and resolve cuts[].source IDs internally. operation="remotion_render" is the LOW-LEVEL direct entry — it expects cuts with pre-resolved file paths and ignores asset_manifest. The matrix's `_build_inputs` was building ID-shaped sources for ALL cells. The cinematic-trailer__remotion-render cell hit Remotion with `source: "a0"` literally, which proxied to `/public/a0` and 404'd. Fix: `_build_inputs` now builds operation-appropriate inputs. remotion_render cells get literal paths in cuts[].source and no asset_manifest. render/compose cells continue to get IDs + manifest. This also documents the contract: each operation's expected input shape lives in the cell-builder. If a future operation expects something different, this is the obvious place to add it. ### Result 12/12 cells pass in 32s, well under the 10-min nightly budget. The full matrix is now a real safety net. 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