Skip to content

Freeze an existing Remotion project

rereel renders with your own Remotion project. Check these points first:

  • Entry file. rereel uses template.entry if it is set, otherwise the first of src/index.ts, src/index.tsx, src/index.js and src/Root.tsx that 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 like media/bg_3fa9c2d1.png, and build copies hydrated media into public/media/ of the staged template. Load them with staticFile(props.background).
  • Duration from props. build computes the frame count from props (duration_sec, durationSec, durationInFrames/fps, …) or timing.json. Make the composition’s durationInFrames at least that long, for example with calculateMetadata reading the same field.
  • remotion installed in the template (node_modules/.bin/remotion), or set REREEL_REMOTION_BIN.
  1. 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
  2. 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":"…"}

    storedCount is the number of files uploaded to the provider, and templateCount the number locked as template assets (public/fonts|sfx|sample/).

  3. Check the rewritten props.

    Terminal window
    git diff --no-index work/props.json reels/ep01/props.json

    Every resolved media path now reads media/<stem>_<sha8>.<ext>. Paths that are still unchanged were not found. Fix them and re-run freeze. validate reports them as UNLOCKED_ASSET.

  4. Validate and build.

    Terminal window
    npx @mathrunet/rereel validate reels/ep01
    npx @mathrunet/rereel build reels/ep01
  5. Ignore build output and commit.

    .gitignore
    **/media/
    **/build/

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.

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.