Lockfile and hydration
freeze: from a working directory to a lockfile
Section titled “freeze: from a working directory to a lockfile”rereel freeze <reel_dir> --props <props.json> [--mix-plan <mix_plan.json>] ... walks props.json and mix_plan.json recursively. A string value is treated as a media reference when:
- it ends in a media extension:
png jpg jpeg webp gif avif mp4 webm mov m4v mkv wav mp3 m4a aac ogg opus flac ttf otf woff woff2 svg - it is not an
http(s)://ordata:URL - its key is not
output,layoutReportorlog
The reference is resolved against these search bases, in order: the reel directory, the directory of --props, the directory of --mix-plan, <template-dir>/public, and <template-dir>. Absolute paths are used as-is. A reference that cannot be resolved is left untouched, unless an entry with that exact key is already in the lockfile, in which case the entry is kept.
For each resolved file, freeze:
- computes its SHA-256 and size
- if the lockfile already has an entry with the same hash and a storage URI, reuses that entry and its path, without uploading again
- otherwise calls
store()on the selected provider (--provider, ordefaultProvider) and gets back a URI - probes images, video and audio with
ffprobeto recorddurationSec,width,height,fps, andvfr: truewhen the real and average frame rates differ by more than 0.25 - writes the entry under the key
media/<stem>_<sha8><ext>and copies the file there (skip the copy with--no-keep-media) - rewrites the string in the JSON to that key
{ "schemaVersion": 1, "items": { "media/bg_s001_3fa9c2d1.png": { "source": "storage", "provider": "r2", "uri": "s3://my-video-assets/rereel/3f/3fa9c2d1....png", "sha256": "3fa9c2d1...", "bytes": 482113, "kind": "image", "width": 1920, "height": 1080 }, "fonts/NotoSansJP-Bold.ttf": { "source": "template", "templateRel": "public/fonts/NotoSansJP-Bold.ttf", "sha256": "9b0e...", "bytes": 5730032, "kind": "font" } }}The lockfile is rebuilt from the references found on each freeze, so entries that are no longer referenced are dropped. Items are sorted by key.
Template sources
Section titled “Template sources”Files that resolve inside <template-dir>/public/fonts/, public/sfx/ or public/sample/ are not uploaded. They are locked with source: "template" and a templateRel path, and the JSON reference becomes the path relative to public/ (e.g. fonts/NotoSansJP-Bold.ttf). These assets ship with the template. Other files under public/ are stored like any other media.
The Remotion template itself is referenced from rereel.json template:
template.source |
Resolved from |
|---|---|
local |
template.path, resolved relative to the reel directory; must contain package.json |
builtin |
$REREEL_TEMPLATES_DIR/<name>/ or ~/.samurai/templates/remotion/<name>/ |
storage |
template.uri fetched through template.provider as a .tar.gz, extracted once into ~/.cache/rereel/templates/<name>-<hash>/ |
build --template-dir <dir> overrides all three.
Re-freezing
Section titled “Re-freezing”freeze reads an existing rereel.json and uses its values as defaults for any flag you omit, so you can re-run it after adding media. Re-freezing a reel in place (--props <reel_dir>/props.json) works: the existing media/... references resolve inside the reel directory, match by hash, and are kept without re-uploading.
Content-addressed storage
Section titled “Content-addressed storage”The default local-cache provider is a content-addressed store (CAS) at ~/.cache/rereel/cas/. Objects live at <cacheDir>/<sha[0:2]>/<sha><ext>, and the URI is cas://<sha><ext>. The S3-compatible provider uses the same layout under its prefix: s3://<bucket>/<prefix>/<sha[0:2]>/<sha><ext>. Identical bytes are stored once, however many reels use them.
hydrate: restore and verify
Section titled “hydrate: restore and verify”rereel hydrate <reel_dir> (also run automatically at the start of build) iterates over the lockfile:
source: "template": if--template-diris given and the destination is missing, the file is copied from<template-dir>/<templateRel>. These entries are counted astemplateStatic.source: "storage":- if
<reel_dir>/<key>exists and its SHA-256 matches, it counts ascached - with
--offline, any missing or mismatched file is an error (exit1) - otherwise the provider named in the entry’s
providerfield resolves the URI to the destination, and the file is hashed again. A mismatch fails withexpectedandactualin the error JSON.
- if
{"status":"hydrated","reelDir":"/.../reels/ep01","total":7,"fetched":6,"cached":0,"templateStatic":1}What validate checks
Section titled “What validate checks”validate works on the JSON alone, so CI needs no media and no credentials. It reports errors and warnings with stable codes, including UNLOCKED_ASSET (a reference that is neither in the lockfile nor on disk), ABSOLUTE_PATH, MISSING_URI and VFR_MEDIA. With --check-media, it also hashes hydrated files (MEDIA_NOT_HYDRATED, MEDIA_SHA_MISMATCH). See CI validation and validate.