pre-alpha, not on npm yet

Make videos with React.

Motio renders a React tree frame by frame in a real headless Chrome and encodes it with FFmpeg. Open source, Apache-2.0, free for any use.

pnpm create motio my-video Not on npm yet: try it from a clone

Node 22 or later and FFmpeg 5.1 or later. Chrome is not needed: the first render downloads a pinned headless shell.

frame 59 grow 1.000 rise 1.000

Drag the playhead, or focus it and use the arrow keys (Shift moves ten frames). The picture depends on nothing but the frame number: frame 18 always looks like frame 18, in any order, on any tab.

Three commands to a video

Create a project from a starter, preview it in the browser, render an MP4. Every command also runs without a terminal, for scripts and agents.

  1. pnpm create motio my-video Not on npm yet: try it from a clone

    Asks for a folder, a starter and a package manager, writes the project and installs it.

  2. pnpm dev

    Opens a preview with play, scrub, frame stepping, a loop range and a props editor.

  3. pnpm render

    Writes out/intro.mp4. Flags pass through: --frames=0-29 renders the first second.

pre-alphaNothing is published on npm yet. Until it is, try it from a clone: make try DIR=../my-video creates the same project from the repository.

A video is a component

This is the composition in the player above, as the Animation guide shows it. It reads the frame and returns what that frame looks like.

Badge.tsxdocs/guide/examples/src/animation.tsx
import {
	AbsoluteFill,
	interpolate,
	measureSpring,
	spring,
	useCurrentFrame,
	useVideoConfig,
} from "@motiojs/motio";

export const Badge = () => {
	const frame = useCurrentFrame();
	const { fps } = useVideoConfig();
	// From 0 to 1 with a physical spring, starting at frame 10; it overshoots, then settles.
	const grow = spring({ frame, fps, delay: 10, config: { damping: 12, stiffness: 120 } });
	// A spring stretched to exactly 30 frames, without bounce.
	const rise = spring({ frame, fps, durationInFrames: 30, config: { damping: 200 } });
	return (
		<AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
			<div
				style={{
					width: 240 * grow,
					height: 240 * grow,
					borderRadius: "50%",
					backgroundColor: "#ffb000",
					marginTop: interpolate(rise, [0, 1], [200, 0]),
				}}
			/>
		</AbsoluteFill>
	);
};

// How many frames the spring takes to settle, for example to size a Sequence.
export const badgeFrames = measureSpring({ fps: 30, config: { damping: 12, stiffness: 120 } });

No timeline state and no clock. Every moving value comes from useCurrentFrame(), so any frame can be rendered on its own and always gives the same pixels.

useCurrentFrame()
The frame being drawn.
spring()
From 0 to 1 like a physical spring: it overshoots, then settles.
interpolate()
Maps a range of frames to a range of values.
measureSpring()
How many frames a spring needs to settle, to size a sequence.

How a render works

Motio sets the frame number, waits until the page is ready, takes a screenshot and hands the screenshots to FFmpeg. Several tabs render different frames at the same time.

    • <Composition id="Intro">
    • <Series>
    • <Series.Sequence>
    • <Badge />
    • <Series.Sequence>
    • <LowerThird />

    React tree

    Compositions, sequences and your components, bundled with Vite.

  1. Headless Chrome, frame by frame

    A pinned chrome-headless-shell draws each frame. If it looks right in Chrome, it renders right.

  2. out/intro.mp4 H.264BT.709AAC120 frames

    FFmpeg

    Encodes the frames and mixes the audio: H.264, H.265, AV1, VP8, VP9, ProRes, GIF.

Why Motio

Four promises, each one checked by the project rather than claimed.

Apache-2.0

Open source. No per-render or per-seat fees, including distributed rendering and embedding the Player.

Chrome pixels

No reimplementation of CSS or layout. If it looks right in Chrome, it renders right.

Deterministic by test

The same project, props and frame give the same pixels in any order and on any number of tabs, checked on decoded frame hashes.

pnpm exec motio check determinism src/index.ts Intro

Agent-first

Every command has --json output and errors with stable codes. Stills, contact sheets, flicker and determinism checks.

pnpm exec motio doctor --json

Fast, measured

Wall time to render the benchmark's motion and timeline compositions at 1920x1080, both summed, median of the runs. Shorter is better.

macOS, Apple M5

1 tab concurrency 1

Motio 1.75 s
Remotion 6.54 s

3.7x faster

4 tabs concurrency 4

Motio 1.21 s
Remotion 2.13 s

1.8x faster

8 tabs concurrency 8

Motio 1.31 s
Remotion 1.58 s

1.2x faster

Measured with make bench against Remotion 4.0.545 on macOS, Apple M5, 1920x1080. H.264 CRF 18, muted, medians.

Packages

One package per job. Install the ones you use; the core stays small.

And 25 more: @motiojs/animation-utils , @motiojs/audio , @motiojs/compat , @motiojs/elevenlabs , @motiojs/fonts , @motiojs/gif , @motiojs/install-whisper-cpp , @motiojs/layout-utils , @motiojs/light-leaks , @motiojs/lottie , @motiojs/media-utils , @motiojs/motio , @motiojs/motion-blur , @motiojs/noise , @motiojs/openai-whisper , @motiojs/paths , @motiojs/preload , @motiojs/preview , @motiojs/rive , @motiojs/shapes , @motiojs/starburst , @motiojs/text , @motiojs/video-frames , @motiojs/zod-types , create-motio .

Compatibility

Projects written for Remotion's documented API run on Motio through an import alias.

While it builds, the bundler resolves remotion to @motiojs/motio and every @remotion/<name> to its Motio package, so imports can stay as they are. The motio command takes the same arguments and flags.

Compatibility is pinned to the 4.0.545 API and checked against recordings of that release. motio doctor lists every symbol a project uses: supported, approximated, stubbed or missing. Details in Coming from Remotion.

Motio is an independent project, built from public API documentation. It is not affiliated with or endorsed by Remotion.

Running an existing projectterminal
# Add Motio next to the project's dependencies
pnpm add @motiojs/motio
pnpm add -D @motiojs/cli @motiojs/transitions

# Imports stay as they are: check them, then render
pnpm exec motio doctor
pnpm exec motio render src/index.ts Intro out/intro.mp4

Start from a starter

Each one installs, previews and renders with no edits; an integration test generates and renders every starter.

basic

A four-second title animation: spring() and interpolate(), two scenes in a <Series>, an image, a local font and a still for the thumbnail.

pnpm create motio my-video Not on npm yet: try it from a clone

captions

Word-by-word captions from a JSON transcript with @motiojs/captions. The transcript sets the length of the video.

pnpm create motio my-video --template captions Not on npm yet: try it from a clone