Video
Create one narrated 1920×1080 MP4 at 30 fps in /workspace. Use the baked
/opt/remotion harness and dependencies. Never install or download anything.
The sandbox has no network.
Plan before rendering
Draft the complete deck specification first. For every slide include its
on-screen text and narration line. Keep this specification unchanged: pass its
narration lines to synthesize_narration, and later use the full specification
as markdown_representation. It is the durable accessible and editable source;
scene files and props.json are ephemeral.
Refuse requests above the 12-scene product limit rather than silently
shortening them. The selected composition must also be at most 180 seconds.
Composition rules
- Give each slide one clear purpose. Keep safe outer margins, readable body
contrast, restrained motion, and every shape on the 1920×1080 canvas.
- The harness supplies sequencing, narration audio, and the SurfSense
watermark. Do not add another watermark or audio element.
- Use only these system-installed font families:
Inter for normal text,
Lora for editorial titles or quotes, and JetBrains Mono for code and
figures. No other family is available reliably offline. Do not use
loadFont, @font-face, or @remotion/google-fonts.
- Write one complete, self-contained TSX module per slide. Each module must
import every dependency it uses and have a default component export. The
harness writes the module verbatim: it does not inject globals, strip imports,
or rewrite exports. Dependencies must already exist in baked
node_modules.
Use this exact module shape:
import type React from "react";
import {AbsoluteFill, useCurrentFrame, useVideoConfig} from "remotion";
import {stagger} from "../../stagger";
const Scene: React.FC = () => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
const entrance = stagger(frame, fps, 0, 1);
return (
<AbsoluteFill
style={{
alignItems: "center",
backgroundColor: "#101828",
color: "white",
fontFamily: "Inter",
justifyContent: "center",
}}
>
<h1 style={{fontSize: 96, ...entrance}}>A clear opening</h1>
</AbsoluteFill>
);
};
export default Scene;
There are no assumed React, AbsoluteFill, useCurrentFrame,
useVideoConfig, interpolate, spring, staticFile, Audio, or stagger
globals. Import only what that scene uses.
Build loop
- Copy
/opt/remotion to a fresh per-render work directory.
- Call
synthesize_narration once with every {slide_number, transcript} and
that work directory. It writes files under public/ and returns filenames.
Never fetch audio yourself.
- Write
props.json with fps, min_duration_in_frames, and ordered
{slide_number, code, audio} scenes. Use returned audio filenames exactly.
- Run
node render.mjs --preflight props.json. It validates input, writes the
verbatim modules, bundles them, selects the composition, and enforces the
180-second limit without rendering frames.
- Run
node render.mjs --stills props.json /tmp/stills. Inspect each scene's
start, middle, and end PNG plus contact-sheet.png for clipping, overflow,
contrast, hierarchy, blank frames, and safe margins.
- If preflight or still review fails, make one coordinated repair and repeat
preflight and still review once. If it still fails, stop; do not keep
repairing.
- Run the full
node render.mjs props.json /workspace/out.mp4. The harness
measures narration with parseMedia, derives timing, segments long renders,
and concatenates them. Do not hand-calculate audio frame counts.
- Call
verify_artifact(path="/workspace/out.mp4", format="video"). If it reports a blocking
finding, make one final repair, then run preflight, still review, render, and
verification once more. A second verification failure is terminal.
- Call
save_artifact only after the exact MP4 verifies, passing the step-1
deck specification as markdown_representation.
The workflow permits at most two repairs total: one compile/still repair and
one final verification repair.
A render must fit the sandbox operation timeout. The harness controls segment
size; do not bypass it. A successful save removes the render work directory;
if rendering or verification fails terminally, remove that directory before
reporting the failure. For revisions, regenerate from the restored Markdown
specification plus the user's instruction, then render and verify a new MP4.
Do not edit current.mp4 in place.
1---2name: video3description: Create polished narrated MP4 videos with Remotion in the sandbox.4---56# Video78Create one narrated 1920×1080 MP4 at 30 fps in `/workspace`. Use the baked9`/opt/remotion` harness and dependencies. Never install or download anything.10The sandbox has no network.1112## Plan before rendering1314Draft the complete deck specification first. For every slide include its15on-screen text and narration line. Keep this specification unchanged: pass its16narration lines to `synthesize_narration`, and later use the full specification17as `markdown_representation`. It is the durable accessible and editable source;18scene files and `props.json` are ephemeral.1920Refuse requests above the 12-scene product limit rather than silently21shortening them. The selected composition must also be at most 180 seconds.2223## Composition rules2425- Give each slide one clear purpose. Keep safe outer margins, readable body26 contrast, restrained motion, and every shape on the 1920×1080 canvas.27- The harness supplies sequencing, narration audio, and the SurfSense28 watermark. Do not add another watermark or audio element.29- Use only these system-installed font families: `Inter` for normal text,30 `Lora` for editorial titles or quotes, and `JetBrains Mono` for code and31 figures. No other family is available reliably offline. Do not use32 `loadFont`, `@font-face`, or `@remotion/google-fonts`.33- Write one complete, self-contained TSX module per slide. Each module must34 import every dependency it uses and have a default component export. The35 harness writes the module verbatim: it does not inject globals, strip imports,36 or rewrite exports. Dependencies must already exist in baked `node_modules`.3738Use this exact module shape:3940```tsx41import type React from "react";42import {AbsoluteFill, useCurrentFrame, useVideoConfig} from "remotion";43import {stagger} from "../../stagger";4445const Scene: React.FC = () => {46 const frame = useCurrentFrame();47 const {fps} = useVideoConfig();48 const entrance = stagger(frame, fps, 0, 1);4950 return (51 <AbsoluteFill52 style={{53 alignItems: "center",54 backgroundColor: "#101828",55 color: "white",56 fontFamily: "Inter",57 justifyContent: "center",58 }}59 >60 <h1 style={{fontSize: 96, ...entrance}}>A clear opening</h1>61 </AbsoluteFill>62 );63};6465export default Scene;66```6768There are no assumed `React`, `AbsoluteFill`, `useCurrentFrame`,69`useVideoConfig`, `interpolate`, `spring`, `staticFile`, `Audio`, or `stagger`70globals. Import only what that scene uses.7172## Build loop73741. Copy `/opt/remotion` to a fresh per-render work directory.752. Call `synthesize_narration` once with every `{slide_number, transcript}` and76 that work directory. It writes files under `public/` and returns filenames.77 Never fetch audio yourself.783. Write `props.json` with `fps`, `min_duration_in_frames`, and ordered79 `{slide_number, code, audio}` scenes. Use returned audio filenames exactly.804. Run `node render.mjs --preflight props.json`. It validates input, writes the81 verbatim modules, bundles them, selects the composition, and enforces the82 180-second limit without rendering frames.835. Run `node render.mjs --stills props.json /tmp/stills`. Inspect each scene's84 start, middle, and end PNG plus `contact-sheet.png` for clipping, overflow,85 contrast, hierarchy, blank frames, and safe margins.866. If preflight or still review fails, make one coordinated repair and repeat87 preflight and still review once. If it still fails, stop; do not keep88 repairing.897. Run the full `node render.mjs props.json /workspace/out.mp4`. The harness90 measures narration with `parseMedia`, derives timing, segments long renders,91 and concatenates them. Do not hand-calculate audio frame counts.928. Call `verify_artifact(path="/workspace/out.mp4", format="video")`. If it reports a blocking93 finding, make one final repair, then run preflight, still review, render, and94 verification once more. A second verification failure is terminal.959. Call `save_artifact` only after the exact MP4 verifies, passing the step-196 deck specification as `markdown_representation`.9798The workflow permits at most two repairs total: one compile/still repair and99one final verification repair.100101A render must fit the sandbox operation timeout. The harness controls segment102size; do not bypass it. A successful save removes the render work directory;103if rendering or verification fails terminally, remove that directory before104reporting the failure. For revisions, regenerate from the restored Markdown105specification plus the user's instruction, then render and verify a new MP4.106Do not edit `current.mp4` in place.