Freeze an existing Remotion project
Prepare the template
Section titled “Prepare the template”rereel renders with your own Remotion project. Check these points first:
- Entry file. rereel uses
template.entryif it is set, otherwise the first ofsrc/index.ts,src/index.tsx,src/index.jsandsrc/Root.tsxthat exists. - Props come from
--props. The composition must read its content from input props, not from hard-coded imports. - Media through
staticFile(). After freezing, media strings look likemedia/bg_3fa9c2d1.png, andbuildcopies hydrated media intopublic/media/of the staged template. Load them withstaticFile(props.background). - Duration from props.
buildcomputes the frame count from props (duration_sec,durationSec,durationInFrames/fps, …) ortiming.json. Make the composition’sdurationInFramesat least that long, for example withcalculateMetadatareading the same field. remotioninstalled in the template (node_modules/.bin/remotion), or setREREEL_REMOTION_BIN.
-
Collect the inputs.
Directorymy-video/
Directoryremotion/
- package.json
- src/index.ts
Directorypublic/
- fonts/NotoSansJP-Bold.ttf locked as a template asset
- bg.png stored and locked as media
Directorywork/
- props.json
- mix_plan.json optional
- captions.srt optional
- voice/take1.wav
-
Run freeze.
Terminal window npx @mathrunet/rereel freeze reels/ep01 \--props work/props.json \--mix-plan work/mix_plan.json \--captions work/captions.srt \--template-dir remotion \--template-source local --template-path ../../remotion \--composition Main \--aspect 16:9 --fps 30 --chunk-frames 300{"status":"frozen","reelDir":"/.../reels/ep01","lockedCount":7,"storedCount":6,"templateCount":1,"rereelSha256":"…"}storedCountis the number of files uploaded to the provider, andtemplateCountthe number locked as template assets (public/fonts|sfx|sample/). -
Check the rewritten props.
Terminal window git diff --no-index work/props.json reels/ep01/props.jsonEvery resolved media path now reads
media/<stem>_<sha8>.<ext>. Paths that are still unchanged were not found. Fix them and re-run freeze.validatereports them asUNLOCKED_ASSET. -
Validate and build.
Terminal window npx @mathrunet/rereel validate reels/ep01npx @mathrunet/rereel build reels/ep01 -
Ignore build output and commit.
.gitignore **/media/**/build/
Freeze options
Section titled “Freeze options”From rereel freeze --help:
| Flag | Default | Stored in rereel.json |
|---|---|---|
--props <path> |
— | rewritten to props.json |
--mix-plan <path> |
— | rewritten to mix_plan.json |
--template-dir <dir> |
— | no: only used to find media at freeze time |
--template-source local|builtin|storage |
builtin |
template.source |
--template-name <name> |
basic |
template.name |
--template-uri <uri> |
— | template.uri (for storage) |
--composition <id> |
Main |
template.composition |
--aspect 16:9|9:16|1:1 |
16:9 |
video.aspect, and the default size (1920×1080, 1080×1920, 1080×1080) |
--width, --height |
from aspect | video.width, video.height |
--fps |
30 |
video.fps |
--chunk-frames |
300 |
video.chunkFrames |
--audio-mode mix_plan|remotion|none |
mix_plan |
audioMode |
--provider <name> |
defaultProvider |
per lock entry |
--storage-config <path> |
see Storage providers | — |
These flags are accepted by the parser but not listed in --help:
| Flag | Effect |
|---|---|
--template-path <dir> |
template.path for local templates, relative to the reel directory |
--template-provider <name> |
template.provider for storage templates |
--entry <file> |
template.entry |
--kind remotion_single|remotion_chapter|composite_merge |
kind (default remotion_single) |
--slice-preset auto|kogatana|scenes|lyrics|custom |
slicePreset (default auto) |
--timing, --captions, --chapters <path> |
copied as timing.json, captions.srt, chapters.json |
--tags <text> |
passed to a command provider’s {tags} |
--no-keep-media |
do not copy files into <reel_dir>/media/ after storing |
Any flag you omit falls back to the value in an existing rereel.json, then to the default.
Re-freezing keeps existing settings and custom file names, including customSlices, parts, and video.remotionArgs. Omit --props and --mix-plan to use the files already in the bundle. Existing media lock entries remain usable even when media/ is absent.
Storing in a shared bucket
Section titled “Storing in a shared bucket”The default provider is local-cache, which works on one machine only. For a team or CI, configure R2, S3 or GCS before the first freeze (set defaultProvider or pass --provider r2). See Storage providers.
Re-freezing does not move existing entries to another provider: a file whose SHA-256 is already locked with a URI keeps that entry. To migrate a reel from local-cache to a bucket, freeze again from the original working props with a fresh lockfile (delete rereel.lock.json first), passing --provider.