Skip to content

Quick Start

This walkthrough has two parts. Part 1 uses the bundled example and needs only Node.js. Part 2 runs the full loop, including rendering, on your own Remotion project.

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

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.

  1. Validate. This needs no media on disk.

    Terminal window
    git clone https://github.com/mathrunet/rereel
    npx @mathrunet/rereel validate rereel/examples/minimal-short
    {"valid":true,"reelDir":".../examples/minimal-short","errors":[],"warnings":[{"level":"warning","code":"MIX_PLAN_MISSING","path":"mix_plan.json","message":"mix_plan.json missing; will be derived from props.json if possible"}]}

    The warning is expected. audioMode is mix_plan, but this reel has no audio, so there is nothing to mix.

  2. 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":"mix_plan","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}
  3. Predict the rebuild. Each chunk hash includes only the timed items whose window, padded by 30 frames, overlaps that chunk:

    Edit in props.json Item window Chunk 0 (0–149) Chunk 1 (150–299)
    hook.text 0–3 s → frames 0–90 re-render reused
    cta.text 7–10 s → frames 210–300 reused re-render
    scenes[0].text 3–7 s → frames 90–210 re-render re-render

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 Main
      • Directorypublic/
        • …
    • Directorywork/
      • props.json references bg.png, broll/city.mp4, voice/take1.wav …
      • mix_plan.json narration, BGM, SFX
    • Directoryreels/
      • …
  1. Freeze the working props into a reel directory:

    Terminal window
    cd my-video
    npx @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.json and mix_plan.json that 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 to reels/ep01/media/<name>_<sha8>.<ext>, and rewritten to that path.

  2. Validate:

    Terminal window
    npx @mathrunet/rereel validate reels/ep01

    valid: true means every media reference is in the lockfile, no path is absolute, and every storage entry has a URI. Exit code 1 means the reel is invalid.

  3. Build:

    Terminal window
    npx @mathrunet/rereel build reels/ep01

    For 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}

    build hydrates missing media first, renders each chunk with remotion render --frames <start>-<end> --muted, concatenates the chunks with ffmpeg -c copy, then compiles mix_plan.json into the soundtrack.

  4. 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.

  5. 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 from build/chunks/. The audio mix is recompiled on every build. It is a single FFmpeg pass, so it takes seconds.

  6. 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.json
    git commit -m "ep01: Monday caption"

    Also commit timing.json, captions.srt, chapters.json and diagrams/*.svg if your reel has them.