Skip to content

Installation

Requirement Why
Node.js >= 22 Declared in engines. rereel uses built-in fetch and node:crypto and has no runtime dependencies.
ffmpeg and ffprobe in PATH Probing media, concatenating chunks, silencedetect, loudness measurement, the audio mix and the final mux. FFmpeg 7.1 and later are supported, including 9.x. Older builds fall back to -filter_complex_script automatically.
A Remotion project (for build only) rereel does not bundle Remotion. It runs the remotion CLI from your template.
tar Only when a template is fetched from storage (template.source: "storage").

freeze, hydrate, validate, inspect and patch do not need Remotion. validate, inspect and patch do not need FFmpeg either, so they run in lightweight CI images.

During build, rereel copies your template into <reel_dir>/build/template/ (skipping node_modules, .remotion, out and props) and runs the first Remotion binary it finds:

  1. $REREEL_REMOTION_BIN, if set
  2. build/template/node_modules/.bin/remotion
  3. npx remotion

node_modules is cloned from the source template when it exists. Otherwise rereel runs npm ci (or npm install if there is no package-lock.json) once and caches the result in ~/.cache/rereel/node_modules/. Install remotion and @remotion/cli in the template project itself, not in the project that runs rereel.

Terminal window
npm install -D @mathrunet/rereel

This installs the rereel binary. Run it with npx rereel or from an npm script. Without installing:

Terminal window
npx @mathrunet/rereel --help

The rest of these docs use npx @mathrunet/rereel. If rereel is installed in the project, npx rereel is equivalent.

Terminal window
npx @mathrunet/rereel --help
ffmpeg -version
ffprobe -version

--help (or -h, or running with no arguments) prints usage to stderr and exits with code 0. Every other command prints a single JSON line to stdout.

Variable Effect
REREEL_FFMPEG_BIN Path to ffmpeg (default ffmpeg).
REREEL_FFPROBE_BIN Path to ffprobe (default ffprobe).
REREEL_REMOTION_BIN Remotion CLI used by build.
REREEL_TEMPLATES_DIR Root for builtin templates: <dir>/<template.name>/package.json.
REREEL_STORAGE_CONFIG Path to a storage config, if --storage-config is not passed. See Storage providers.

The same functions the CLI uses are exported from the package entry (ESM only):

import { validateReel, inspectReel, rippleShiftReel } from "@mathrunet/rereel";
const res = validateReel("./reels/ep01");
if (!res.valid) console.error(res.errors);

See the API reference.