Incremental rendering
Chunks
Section titled “Chunks”build converts the duration to frames and splits it into fixed windows of video.chunkFrames frames (default 300, i.e. 10 s at 30 fps):
totalFrames = round(durationSec × fps)chunks: [0, 299] [300, 599] [600, 899] ... [n×chunkFrames, totalFrames−1]files: build/chunks/00000-00299.mp4, 00300-00599.mp4, ...The duration comes from the first match of: timing.json duration_sec, then props duration_sec, durationSec, durationInFrames / fps, clip.end_sec − clip.start_sec, and outline.duration_sec. If none is found, the build fails with exit 2.
Each chunk is rendered with:
remotion render <entry> <composition> build/chunks/<start>-<end>.mp4 \ --props <reel_dir>/props.json --frames <start>-<end> \ --concurrency=2 --image-format=jpeg --log=error --muted --jpeg-quality=80 [...remotionArgs]--muted is added unless audioMode is remotion. --jpeg-quality is added only for imageFormat: "jpeg". The defaults come from video.concurrency, video.imageFormat, video.jpegQuality and video.remotionArgs in rereel.json. After rendering, ffprobe counts the chunk’s frames, and a count that differs from end − start + 1 fails the build.
Slice hashing
Section titled “Slice hashing”A chunk is reused only if build/chunks/manifest.json stores the same slice key for it, the file exists, and its frame count is still correct. The key is a SHA-256 over canonical (sorted-key) JSON of:
| Input | Effect of a change |
|---|---|
frames: [start, end] |
Changing chunkFrames renames and re-renders all chunks |
composition, entry, fps, imageFormat, jpegQuality, extraArgs |
All chunks |
templateSha256: hash of the template’s package.json, remotion.config.* and every file under src/ |
All chunks |
propsSlice: see below |
Only chunks whose slice changed |
mediaHashes: lockfile SHA-256 of each media path referenced inside the slice |
Only chunks that show that media |
The props slice
Section titled “The props slice”For each chunk, rereel copies props.json but filters the timed collections down to items whose frame window overlaps [start − 30, end + 30]. The 30-frame padding covers transitions that bleed across a boundary.
| Props key | Treatment |
|---|---|
cuts, edit.cuts |
filtered |
scenes (array) or scenes.scenes |
filtered |
overlays (array) or overlays.overlays |
filtered |
dialogue |
filtered |
hook, cta (single objects) |
kept if overlapping, else null |
images.shots, structure.sections |
filtered |
audio |
ignored: audio is mixed outside the video chunks |
anything else (theme, palette, duration_sec, captions, …) |
global: included in every chunk’s slice |
An item’s window is read from the first field set it has:
| Fields | Window (frames) |
|---|---|
fromFrame + durationInFrames |
[fromFrame, fromFrame + durationInFrames] |
startFrame + endFrame / durationInFrames |
[startFrame, endFrame] |
atFrame + durationInFrames / durationSec / duration_sec |
defaults to 4 s if no duration |
start_sec + end_sec / duration_sec |
[floor(start×fps), ceil(end×fps)] |
startSec + endSec / durationSec |
same |
only duration_sec |
placed sequentially after the previous such item |
Items with no recognizable timing are kept in every chunk. Missing durations default to 1 frame (frame fields) or 1 s (second fields).
Slice presets
Section titled “Slice presets”rereel.json slicePreset is auto (default), kogatana, scenes, lyrics or custom. auto chooses a preset from the props shape. Kogatana uses cuts and overlays, scenes uses scenes, dialogue, and overlays, and lyrics uses shots, song sections, and overlays. Each named preset also slices the hook and CTA. The generic fallback recognizes all standard collections. See slice presets.
custom uses customSlices instead:
{ "slicePreset": "custom", "customSlices": [ { "arrayPath": "timeline.clips", "startSecKey": "in", "endSecKey": "out", "padFrames": 15 } ]}Each extractor names a dot-path to an array and the keys to read: startSecKey + endSecKey/durationSecKey, or startFrameKey + durationFramesKey, plus optional padFrames (default 30). Top-level keys whose root is not an extractor’s root stay global.
Concatenation
Section titled “Concatenation”Once every chunk is current, rereel writes build/chunks/concat.txt and joins the chunks with the concat demuxer, without re-encoding:
ffmpeg -f concat -safe 0 -i concat.txt -an -c copy -movflags +faststart build/video.muted.mp4(-an is omitted when audioMode is remotion.) Because chunks come from one Remotion configuration, their stream parameters match, so a stream copy is safe and takes almost no time. The audio is then compiled and muxed onto this file. See Audio compilation. The result is build/output.mp4 unless you pass --out.
Composite merge
Section titled “Composite merge”For kind: "composite_merge", build:
- hydrates the parent reel
- builds each
parts[]entry withkind: "chapter"as a child reel (incrementally, with its own chunk cache) - takes each
kind: "media"part (e.g. an opening or end card) from the locked media - concatenates all parts into
build/final.video.mp4with-c:v copy, falling back to alibx264re-encode atvideo.fpsif the stream copy fails - compiles
mix_plan.jsonat final scope, and muxes the result tobuild/final.mp4(or--out)
The chunksTotal, chunksRendered and chunksReused counts in the output are summed across child reels.
Staged template workspace
Section titled “Staged template workspace”Rendering happens in <reel_dir>/build/template/, a copy of the template with hydrated media/ copied into public/media/. Media paths in props such as media/bg_3fa9c2d1.png must therefore be loaded with Remotion’s staticFile().