Quick Start
Start with the bundled example to validate, inspect, and render a reel. Then freeze and edit a reel from your own Remotion project.
Part 1: the example reel
Section titled “Part 1: the example reel”The repository contains a ten-second 9:16 reel with no media, at examples/minimal-short:
Directoryexamples/minimal-short/
- rereel.json
- rereel.lock.json
- props.json
Directorytemplate/ Local Remotion project
- …
rereel.json sets fps: 30 and chunkFrames: 150, so the 10 s timeline (300 frames) is split into two chunks, 00000-00149 and 00150-00299.
-
Validate. This needs no media on disk.
Terminal window git clone https://github.com/mathrunet/rereelnpx @mathrunet/rereel validate rereel/examples/minimal-short{"valid":true,"reelDir":".../examples/minimal-short","errors":[],"warnings":[]} -
Inspect.
Terminal window npx @mathrunet/rereel inspect rereel/examples/minimal-short{"reelDir":"...","kind":"remotion_single","video":{"width":1080,"height":1920,"aspect":"9:16","fps":30,"chunkFrames":150},"audioMode":"none","lockedAssets":0,"scenes":[{"id":"scene_1","startSec":3,"endSec":7,"text":"Edit 1 line in props.json.\nRebuild only 1 chunk."}],"cutsCount":0,"narrationSegments":0,"bgmCues":0,"sfxCues":0} -
Predict the rebuild. Each chunk hash includes only the timed items whose window, padded by 30 frames, overlaps that chunk:
Edit in props.jsonItem window Chunk 0 (0–149) Chunk 1 (150–299) hook.text0–3 s → frames 0–90 re-render reused cta.text7–10 s → frames 210–300 reused re-render scenes[0].text3–7 s → frames 90–210 re-render re-render -
Render. With FFmpeg and FFprobe installed, build the example with its bundled Remotion template:
Terminal window npx @mathrunet/rereel build rereel/examples/minimal-shortThe first build installs the template’s pinned dependencies and may download a compatible Chrome binary. Open
rereel/examples/minimal-short/build/output.mp4, changehook.textin the example’sprops.json, and run the build again. The result reports one rendered chunk and one reused chunk.
Part 2: your Remotion project
Section titled “Part 2: your Remotion project”Assume this layout. work/ holds the props you currently pass to remotion render, and media paths are resolved with staticFile() in your composition.
Directorymy-video/
Directoryremotion/ Remotion project: package.json, src/index.ts, composition
MainDirectorypublic/
- …
Directorywork/
- props.json references bg.png, broll/city.mp4, voice/take1.wav …
- mix_plan.json narration, BGM, SFX
Directoryreels/
- …
-
Freeze the working props into a reel directory:
Terminal window cd my-videonpx @mathrunet/rereel freeze reels/ep01 \--props work/props.json \--mix-plan work/mix_plan.json \--template-dir remotion \--template-source local --template-path ../../remotion \--composition Main --aspect 16:9 --fps 30{"status":"frozen","reelDir":"/.../reels/ep01","lockedCount":6,"storedCount":6,"templateCount":0,"rereelSha256":"5f0c…"}Every string in
props.jsonandmix_plan.jsonthat ends in a media extension and resolves to a file is hashed, stored with the default provider (local-cache, i.e.~/.cache/rereel/cas/), copied toreels/ep01/media/<name>_<sha8>.<ext>, and rewritten to that path. -
Validate:
Terminal window npx @mathrunet/rereel validate reels/ep01valid: truemeans every media reference is in the lockfile, no path is absolute, and every storage entry has a URI. Exit code1means the reel is invalid. -
Build:
Terminal window npx @mathrunet/rereel build reels/ep01For a 45 s video at 30 fps with the default
chunkFrames: 300, the first build renders all five chunks:{"status":"built","reelDir":"/.../reels/ep01","outPath":"/.../reels/ep01/build/output.mp4","sha256":"…","totalFrames":1350,"fps":30,"chunksTotal":5,"chunksRendered":5,"chunksReused":0}buildhydrates missing media first, renders each chunk withremotion render --frames <start>-<end> --muted, concatenates the chunks withffmpeg -c copy, then compilesmix_plan.jsoninto the soundtrack. -
Edit one cut. In
reels/ep01/props.json, change the overlay shown from 16 s to 18 s:"overlays": [{ "start_sec": 16, "end_sec": 18,"text": "Ship it on Friday" }"text": "Ship it on Monday" }]Only items inside the collections rereel knows how to slice (
cuts,scenes,overlays,dialogue,hook,cta,images.shots,structure.sections) are scoped to their own chunks. Any other top-level key counts as global, and editing it re-renders every chunk. See Incremental rendering. -
Rebuild:
Terminal window npx @mathrunet/rereel build reels/ep01{"status":"built","reelDir":"/.../reels/ep01","outPath":"/.../reels/ep01/build/output.mp4","sha256":"…","totalFrames":1350,"fps":30,"chunksTotal":5,"chunksRendered":1,"chunksReused":4}Frames 480–540 (plus 30 frames of padding) fall only inside chunk
00300-00599. The other four chunks are reused frombuild/chunks/. The audio mix is recompiled on every build. It is a single FFmpeg pass, so it takes seconds. -
Commit only the source of truth:
.gitignore **/media/**/build/Terminal window git add .gitignore reels/ep01/rereel.json reels/ep01/rereel.lock.json \reels/ep01/props.json reels/ep01/mix_plan.jsongit commit -m "ep01: Monday caption"Also commit
timing.json,captions.srt,chapters.jsonanddiagrams/*.svgif your reel has them.
Part 3: let your agent do the edit
Section titled “Part 3: let your agent do the edit”Install the rereel skill so that your coding agent can run steps 4 and 5 for you. In Claude Code:
/plugin install rereel --marketplace mathrunet/rereelFor Codex, Cursor and other agents:
npx skills add mathrunet/rereelThen ask in plain words:
In reels/ep01, change the overlay at 16 s to “Ship it on Monday”, rebuild, and tell me how many chunks re-rendered.
The agent inspects the reel, edits one line of props.json, validates, rebuilds and reports chunksRendered: 1. See Using rereel with AI agents.
- Video-as-Code: the model behind these files
- Freeze an existing Remotion project: template requirements in detail
rereel buildreference