# Coming from Remotion

> How Remotion concepts map to vidmake, with side-by-side React and JSON for interpolate, spring, Sequence, Series and TransitionSeries, input props, components, audio visualization and captions, and what is different or missing.

[Remotion](https://www.remotion.dev) makes videos from React components rendered in a headless browser. vidmake
takes the same core idea (every frame is a pure function of the frame number) and expresses it as data: a JSON
file instead of a React app, a native Rust renderer instead of Chrome, and inspection commands instead of the
Studio. If you know Remotion, most concepts carry over one to one.

| | Remotion | vidmake |
|---|---|---|
| source | React/TypeScript components | one JSON file ([schema](https://vidmake.app/docs/schema.md)) |
| frame logic | any JavaScript per frame | [keyframes, tweens, springs](https://vidmake.app/docs/animation.md), [expressions](https://vidmake.app/docs/expressions.md) |
| renderer | headless Chrome + ffmpeg | native rasterizer (tiny-skia) + the Mac's own media engine |
| preview | Studio, `<Player>` | [`storyboard`, `still`, `inspect`, `timeline`, `trace`](https://vidmake.app/docs/inspecting.md) |
| install | Node, npm packages, a browser | one Mac app |
| best for | apps, anything the web platform can draw | motion graphics, titles, data, captions, templated video written by programs and agents |

## Concept map

| Remotion | vidmake | page |
|---|---|---|
| `<Composition id width height fps durationInFrames>` | an entry in `compositions` with `id`, `width`, `height`, `fps`, `duration` | [compositions](https://vidmake.app/docs/compositions.md) |
| `calculateMetadata()` duration | `"duration": "auto"` (the longest fixed-length layer, media, or series) | [time](https://vidmake.app/docs/time.md) |
| `useCurrentFrame()` | `f` (layer-local frame) and `t` (seconds) in expressions; `gf`/`gt` for global | [expressions](https://vidmake.app/docs/expressions.md) |
| `useVideoConfig()` | `fps`, `w`, `h`, `dur`, `durf` in expressions | [expressions](https://vidmake.app/docs/expressions.md) |
| `interpolate()` | keyframes, tweens, or `map()` / `interpolate()` in expressions | [animation](https://vidmake.app/docs/animation.md) |
| `spring()` | `"ease": "spring(0.2)"` (bounce 0..1), a motion such as `"motion": "snap"`, `"spring": {...}` on a tween, or `spring(f)` in expressions | [easing](https://vidmake.app/docs/easing.md#motion), [animation](https://vidmake.app/docs/animation.md#springs) |
| `Easing.bezier()`, `Easing.out(Easing.cubic)` | `"ease": "cubic-bezier(...)"`, `"easeOutCubic"` | [easing](https://vidmake.app/docs/easing.md) |
| `<Sequence from durationInFrames>` | `start` and `duration` on any layer or `group` | [time](https://vidmake.app/docs/time.md) |
| `<Series>` | a `group` with `"series": true` | [series](https://vidmake.app/docs/series.md) |
| `<TransitionSeries>` + `@remotion/transitions` | `transition` on series children: `fade`, `slide*`, `wipe*`, `zoom`, `blur` | [series](https://vidmake.app/docs/series.md) |
| `<AbsoluteFill>` | a `group` or `rect` (both default to the parent size) | [groups](https://vidmake.app/docs/groups.md) |
| `<Img>`, `<OffthreadVideo>`, `<Audio>` | `image`, `video`, `audio` layers | [images](https://vidmake.app/docs/images.md), [video](https://vidmake.app/docs/video.md), [audio](https://vidmake.app/docs/audio.md) |
| `staticFile()` | a path relative to the project file | [images](https://vidmake.app/docs/images.md) |
| `defaultProps`, input props, `--props` | composition `props`, `{{name}}`, `--props` / `-p` / `--props-file` | [props](https://vidmake.app/docs/props.md) |
| your own components | compositions placed with `use` layers, with their own `props` | [components](https://vidmake.app/docs/components.md) |
| `array.map((x, i) => ...)` | `repeat` with `i` and `n` | [repeat](https://vidmake.app/docs/repeat.md) |
| CSS flexbox | `layout` on a group (`column`/`row`, `gap`, `align`, `justify`) | [groups](https://vidmake.app/docs/groups.md) |
| `@remotion/shapes` | `rect`, `ellipse`, `polygon`, `star`, `arc` | [shapes](https://vidmake.app/docs/shapes.md) |
| `@remotion/paths` `evolvePath()` | `path` / `line` with `drawEnd` (`drawMode: "total"` to draw several sub-paths in turn) | [paths](https://vidmake.app/docs/paths.md) |
| `@remotion/media-utils` `visualizeAudio()` | `waveform` layer; `amp`, `bass`, `beat` in expressions | [waveform](https://vidmake.app/docs/waveform.md), [audio-reactive](https://vidmake.app/docs/audio-reactive.md) |
| `useAudioData()` / `getAudioData()` to inspect a track | `vidmake analyze music.mp3` (beat times, tempo, `amp`/`bass` curves) | [audio-reactive](https://vidmake.app/docs/audio-reactive.md#check-the-soundtrack-with-analyze) |
| `@remotion/captions`, `createTikTokStyleCaptions()` | `captions` layer (`srt`, `vtt`, Whisper JSON), `mode: "word"`, `highlight` | [captions](https://vidmake.app/docs/captions.md) |
| `<CameraMotionBlur>`, `<Trail>` | composition `motionBlur` (per-layer opt-out) | [effects](https://vidmake.app/docs/effects.md) |
| CSS `filter`, `mix-blend-mode`, `box-shadow` | `blur`, `brightness`, `saturation`, `blendMode`, `shadow`, `glow` | [effects](https://vidmake.app/docs/effects.md) |
| CSS `clip-path`, masks | `mask` / `maskMode`, group `clip` | [masks](https://vidmake.app/docs/masks.md) |
| `loadFont()` / `@remotion/google-fonts` | `fonts` entries pointing at local `.ttf`/`.otf` files | [text](https://vidmake.app/docs/text.md) |
| `npx remotion render` | `vidmake render` | [rendering](https://vidmake.app/docs/rendering.md) |
| `npx remotion still` | `vidmake still` | [inspecting](https://vidmake.app/docs/inspecting.md#still) |
| Studio timeline | `vidmake timeline` | [inspecting](https://vidmake.app/docs/inspecting.md#timeline) |

## Side by side

### interpolate()

A fade-in over 20 frames and a slide that starts at frame 10:

```tsx title="Remotion"
const frame = useCurrentFrame();
const opacity = interpolate(frame, [0, 20], [0, 1], { extrapolateRight: 'clamp' });
const x = interpolate(frame, [10, 40], [-200, 960], {
  easing: Easing.out(Easing.cubic), extrapolateLeft: 'clamp', extrapolateRight: 'clamp',
});
return <div style={{ opacity, transform: `translateX(${x}px)` }}>Hello</div>;
```

```json title="vidmake"
{ "id": "title", "type": "text", "text": "Hello",
  "opacity": [[0, 0], [20, 1]],
  "x": { "from": -200, "to": 960, "start": 10, "duration": 30, "ease": "easeOutCubic" } }
```

Keyframes and tweens always clamp outside their range. Numbers are frames; `"0.5s"` works anywhere a time does.
Multi-point interpolation is a keyframe list: `[[0, 0], [20, 1], [100, 1], [120, 0]]`. The expression form is
closest to the original: `"opacity": "=interpolate(f, 0, 20, 0, 1)"` (clamped; `mapu` doesn't clamp).

### spring()

```tsx title="Remotion"
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const scale = spring({ frame, fps, config: { damping: 200 } });
const delayed = spring({ frame: frame - 10, fps, config: { damping: 12, stiffness: 180 } });
```

```json title="vidmake"
"scale": { "from": 0, "to": 1, "spring": { "damping": 200 } }
"scale": "=spring(f - 10, 12, 180)"
```

The physics and defaults are the same as Remotion's (damping 10, stiffness 100, mass 1). In a tween, `delay`
(or `start`) offsets the spring, `from`/`to` map its 0..1 output, and an optional `duration` stretches it to
settle in that time, like Remotion's `durationInFrames`. `"enter": "pop"` is a ready-made spring scale-in.

When you only care about the feel, skip the physics: `"ease": "spring(0.2)"` on any tween or keyframe is a spring
with that bounce that starts from rest and settles exactly at the end of the duration, and a
[motion](https://vidmake.app/docs/easing.md#motion) such as `"motion": { "spring": 0.2, "duration": "0.5s" }` carries the duration too.
Entrances use springs by default (`smooth`), so most layers need no spring of their own.

### Sequence

```tsx title="Remotion"
<Sequence from={30} durationInFrames={60}>
  <Title />
</Sequence>
```

```json title="vidmake"
{ "id": "titleScene", "type": "group", "start": 30, "duration": 60, "children": [
  { "id": "title", "type": "text", "text": "${f}" }
] }
```

As inside a `<Sequence>`, time restarts for the children: `f` and `t` inside are local, so `"${f}"` shows 0 at
frame 30. Every layer has `start` and `duration`, so a group is only needed when several layers share the window.

### Series and TransitionSeries

```tsx title="Remotion"
<TransitionSeries>
  <TransitionSeries.Sequence durationInFrames={48}><SlideOne /></TransitionSeries.Sequence>
  <TransitionSeries.Transition presentation={slide({ direction: 'from-right' })}
    timing={linearTiming({ durationInFrames: 15 })} />
  <TransitionSeries.Sequence durationInFrames={48}><SlideTwo /></TransitionSeries.Sequence>
  <TransitionSeries.Transition presentation={fade()} timing={linearTiming({ durationInFrames: 15 })} />
  <TransitionSeries.Sequence durationInFrames={48}><SlideThree /></TransitionSeries.Sequence>
</TransitionSeries>
```

```json title="vidmake"
{ "id": "deck", "type": "group", "series": true, "children": [
  { "id": "s1", "type": "group", "duration": 48, "transition": { "type": "slideLeft", "duration": 15 }, "children": [] },
  { "id": "s2", "type": "group", "duration": 48, "transition": "fade", "children": [] },
  { "id": "s3", "type": "group", "duration": 48, "children": [] }
] }
```

The transition sits on the outgoing child and overlaps it with the next one, so the series is 48 × 3 − 2 × 15
frames long, as in Remotion. Without `transition` it is a plain `<Series>`; a child's `start` adds a gap
(Remotion's `offset`). Here it is with real content:

**Demo: Slideshow: a series group plays three slides back to back with push and fade transitions** (rendered video: https://vidmake.app/media/recipe-slideshow.mp4)

```json
{
  "fonts": [
    { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" },
    { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }
  ],
  "compositions": [{
    "id": "slides", "description": "Slideshow: a series group plays three slides back to back with push and fade transitions",
    "width": 1280, "height": 720, "fps": 30, "background": "#f4f1ea",
    "layers": [
      { "id": "deck", "type": "group", "series": true, "children": [
        { "id": "s1", "type": "group", "duration": "1.6s", "transition": { "type": "slideLeft", "duration": "0.5s" }, "children": [
          { "id": "s1-bg", "type": "rect", "fill": "#f4f1ea" },
          { "id": "s1-t", "type": "text", "text": "One", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 200, "letterSpacing": -9, "fill": "#161412" } ] },
        { "id": "s2", "type": "group", "duration": "1.6s", "transition": "fade", "children": [
          { "id": "s2-bg", "type": "rect", "fill": "#161412" },
          { "id": "s2-t", "type": "text", "text": "Two", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 200, "letterSpacing": -9, "fill": "#f4f1ea" } ] },
        { "id": "s3", "type": "group", "duration": "1.6s", "children": [
          { "id": "s3-bg", "type": "rect", "fill": "#e9e4d8" },
          { "id": "s3-t", "type": "text", "text": "Three", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 200, "letterSpacing": -9, "fill": "#c92a26" } ] }
      ] },
      { "id": "count", "type": "text", "text": "${pad(min(floor(gt / 1.1) + 1, 3), 2)} / 03", "font": "JetBrains Mono", "fontSize": 16,
        "letterSpacing": 2, "fill": "#8a857a", "anchor": "bottom-right", "x": 1216, "y": 676 }
    ]
  }]
}
```

### Input props and defaultProps

```tsx title="Remotion"
<Composition id="card" component={Card} defaultProps={{ title: 'Hello', color: '#161412' }} ... />
// npx remotion render card out.mp4 --props='{"title":"Launch day"}'
export const Card = ({ title, color }) => <h1 style={{ color }}>{title}</h1>;
```

```json title="vidmake"
{ "id": "card", "width": 1920, "height": 1080, "duration": "5s",
  "props": { "title": "Hello", "color": "#161412" },
  "layers": [ { "id": "title", "type": "text", "text": "{{title}}", "fill": "{{color}}" } ] }
```

```bash
vidmake render card.json -o out.mp4 --props '{"title": "Launch day"}'
vidmake render card.json -o out.mp4 -p title="Launch day" -p color=#c92a26
```

`{{name}}` is replaced before the project is compiled. A string that is exactly `"{{name}}"` takes the prop's
JSON value (a number stays a number, a list stays a list), so props can drive numbers, colors, arrays for
`pick()`, even whole animation objects. There is no zod schema; `validate` warns about unknown `{{names}}`.

### Components

```tsx title="Remotion"
const LowerThird = ({ name }) => {
  const frame = useCurrentFrame();
  return <div style={{ opacity: interpolate(frame, [0, 15], [0, 1]) }}>{name}</div>;
};
// ...
<Sequence from={60}><LowerThird name="Ada" /></Sequence>
```

```json title="vidmake"
{ "compositions": [
  { "id": "main", "width": 1920, "height": 1080, "duration": "8s", "layers": [
    { "id": "lt", "type": "use", "ref": "lowerThird", "start": "2s", "props": { "name": "Ada" } }
  ] },
  { "id": "lowerThird", "width": 1920, "height": 1080, "duration": "3s", "props": { "name": "Name" },
    "layers": [ { "id": "n", "type": "text", "text": "{{name}}", "y": "85%", "enter": "fadeUp" } ] }
] }
```

A component is a composition; a `use` layer places it like a `<Sequence>` with props. Its time starts at the `use`
layer's `start`, and it is clipped to its own size and duration. You can render the component on its own with
`--comp lowerThird`. Logic that would be JavaScript in a component becomes expressions, `repeat` and props.

### Mapping over data

```tsx title="Remotion"
{[120, 340, 260, 420].map((v, i) => (
  <Bar key={i} height={v * spring({ frame: frame - i * 3, fps })} left={i * 90} />
))}
```

```json title="vidmake"
{ "id": "bar", "type": "rect", "width": 60, "anchor": "bottom", "y": 900,
  "repeat": { "count": 4, "layout": "row", "spacing": 90, "delay": 3 },
  "height": "=pick(i, [120, 340, 260, 420]) * spring(f)" }
```

See the [bar chart recipe](https://vidmake.app/docs/recipes.md#bar-chart).

### Audio visualization

```tsx title="Remotion"
const audioData = useAudioData(staticFile('music.mp3'));
if (!audioData) return null;
const bars = visualizeAudio({ fps, frame, audioData, numberOfSamples: 32 });
const bass = bars.slice(0, 4).reduce((a, b) => a + b) / 4;
return (<>
  <Audio src={staticFile('music.mp3')} />
  {bars.map((v, i) => <div key={i} style={{ height: 300 * v }} />)}
  <Logo style={{ transform: `scale(${1 + bass})` }} />
</>);
```

```json title="vidmake"
{ "id": "music", "type": "audio", "src": "music.mp3" },
{ "id": "viz", "type": "waveform", "src": "music.mp3", "bars": 32, "y": "85%" },
{ "id": "logo", "type": "image", "src": "logo.svg", "scale": "=1 + bass" }
```

The `waveform` layer draws bars, a mirrored spectrum or an oscilloscope line. For anything else, the expression
variables `amp`, `bass`, `beat` and `beats` are computed from all the audio in the composition, with beat detection
built in. No loading step: analysis happens at compile time.

The scale differs from `visualizeAudio()`. Its values are raw magnitudes per frequency band, usually well below 1,
which is why Remotion code often multiplies them up. `amp` and `bass` are normalized per composition so the loudest
2% of the soundtrack reads 1, so `1 + bass` really does double the size on every kick, and a loud section can sit
at 1 for seconds. Start with smaller multipliers (`1 + 0.15 * bass`), and run `vidmake analyze` on the track to see
the beat times, the typical values and how long each variable spends at its ceiling, the way you might have
logged `useAudioData()` output.

**Demo: Beat pulse: amp, bass and beat from the music drive scale, glow and color** (rendered video: https://vidmake.app/media/recipe-beat-pulse.mp4)

```json
{
  "fonts": [{ "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }],
  "compositions": [{
    "id": "beat", "description": "Beat pulse: amp, bass and beat from the music drive scale, glow and color",
    "width": 1280, "height": 720, "fps": 30, "duration": "6s", "background": "#131210",
    "layers": [
      { "id": "music", "type": "audio", "src": "assets/music.mp3", "trimStart": "2s", "fadeIn": "0.3s", "fadeOut": "0.6s" },
      { "id": "halo", "type": "ellipse", "width": 420, "y": "46%", "scale": "=1 + 0.35 * bass",
        "fill": { "type": "radial", "stops": ["#efebe222", "#efebe200"] } },
      { "id": "dot", "type": "ellipse", "width": 14, "x": "50%", "y": "46%",
        "repeat": { "count": 24, "layout": "radial", "radius": 170 },
        "scale": "=1 + 1.2 * beat", "fill": "=pick(beats + i, ['#f05a4e', '#6aa6e8', '#efebe2'])" },
      { "id": "core", "type": "text", "text": "beat", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 100, "letterSpacing": -4,
        "fill": "#efebe2", "y": "46%", "scale": "=1 + 0.18 * beat", "glow": { "radius": "=4 + 30 * beat", "color": "#f05a4e" } },
      { "id": "viz", "type": "waveform", "src": "assets/music.mp3", "trimStart": "2s", "mode": "line",
        "y": "88%", "width": "70%", "height": 90, "stroke": "#8f8a7f", "strokeWidth": 2 }
    ]
  }]
}
```

### Captions

```tsx title="Remotion"
const { pages } = createTikTokStyleCaptions({ captions, combineTokensWithinMilliseconds: 800 });
// ...render each page in a <Sequence>, highlight the active token by comparing timestamps
```

```json title="vidmake"
{ "id": "subs", "type": "captions", "src": "subs.srt", "fontSize": 64, "fontWeight": 800,
  "fill": "#ffffff", "highlight": "#c92a26", "stroke": "#000000", "strokeWidth": 10 }
```

`src` takes `.srt`, `.vtt` or Whisper-style JSON (word timestamps are used when present). `"mode": "word"` shows one
word at a time; `highlight` colors the spoken word in line mode. See the [captions recipe](https://vidmake.app/docs/recipes.md#tiktok-style-captions).

### Rendering

```bash
npx remotion render src/index.ts card out/video.mp4 --props='{"title":"Hi"}' --frames=0-89
vidmake render card.json -o out/video.mp4 --props '{"title":"Hi"}' --frames 0-90
```

Note the range: Remotion's `--frames=0-89` is inclusive, vidmake's `--frames 0-90` is end-exclusive (and accepts
times: `--frames 0-3s`). See [rendering](https://vidmake.app/docs/rendering.md).

## What's different

- **No code, no imports.** Everything is declarative JSON. Per-frame logic is limited to the
  [expression language](https://vidmake.app/docs/expressions.md) (math, easing functions, noise, `pick`, color functions); there are no
  loops, variables, hooks, `fetch`, or npm packages. Generate the JSON with any language if you need more.
- **No DOM or CSS.** There's no HTML, CSS layout, SVG filters, iframes, canvas/WebGL or Three.js. Layout is
  absolute positioning plus simple row/column stacks. Text supports wrapping, alignment, letter spacing, rich-text
  spans with their own color, weight, italic and font, gradients and outlines, but not per-span sizes or other CSS
  text features.
- **Local files only.** `src` and font paths are files relative to the project; URLs are not fetched
  (``file not found: ./https://...``). Download remote assets first. There's no `delayRender()` because there is
  nothing to wait for.
- **Fonts are font files.** Declare `.ttf`/`.otf` files in `fonts`, or use installed families (`vidmake fonts`).
- **Time defaults.** Numbers are frames, like Remotion, but every time field also takes `"1.5s"`, `"500ms"`,
  `"1:02"`. Animation times are local to the layer, like inside a `<Sequence>`.
- **Transitions are presets**, not custom presentation components.
- **Inspection replaces the Studio.** Instead of scrubbing, ask: `timeline` for timing, `inspect -t 2s` for
  positions, `trace` for curves, `storyboard` for an overview. These are designed for agents that can't watch video.
- **Rendering is local and native.** No browser, no Lambda/Cloud Run renderer. A single machine renders in parallel
  across cores; distribute by rendering ranges with `--frames` and concatenating if you need to.
- **No `<Player>`.** Render a file and embed it, or show storyboards and stills.

## Porting checklist

1. Create one composition per Remotion `<Composition>` (same `id`, `width`, `height`, `fps`; `duration` from
   `durationInFrames`).
2. Turn each `<Sequence>` into a `group` (or just `start`/`duration` on a single layer), each `<Series>` into a
   `series` group.
3. Replace `interpolate`/`spring` calls with keyframes, tweens or expressions on the field they drive.
4. Move `defaultProps` to `props` and reference them as `{{name}}`.
5. Turn reusable components into compositions placed with `use`.
6. Copy assets next to the project and point `src`/`fonts` at them.
7. `vidmake validate`, `vidmake storyboard`, compare with your Remotion render, then `vidmake render`.

> [!AGENT]
> When asked to port a Remotion project, read the components for timing (frames per `<Sequence>`), props and
> assets first, write one composition at a time, and validate after each. `vidmake docs` has the full field list.
