Author a deterministic React-based Remotion composition and render it to MP4 through Aident Loadout.
Author a deterministic React-based Remotion composition and render it to MP4 through Aident Loadout.
# Remotion MP4 Composition
Turn a reviewed video brief into a deterministic, self-contained Remotion composition and render it as an MP4 asset.
## Loadout capabilities
Use <action-tag>cli:remotion_cli:render</action-tag> only after the entry point and composition ID pass the review checklist below. The Action creates an isolated project with aligned `remotion`, `react`, `react-dom`, and `zod` packages, renders the selected composition, and returns the MP4 as an Aident asset. It does not accept a project directory or extra package manifest.
Reading this Skill does not render anything. Call the Action separately through `capabilities_execute`, preserving its authorization, pricing, and approval requirements.
## When to use
Use this workflow for precise, code-defined motion graphics that can be expressed in one React and TypeScript entry point. It is a good fit for title cards, explainers, charts made with HTML or inline SVG, branded announcements, and other deterministic compositions.
Do not use it for prompt-only generative video, editing an existing video file, projects that require extra npm packages, or compositions that depend on local files. Choose another capability when those requirements are essential.
Before authoring, obtain:
- the message, audience, and acceptance criteria;
- width, height, frames per second, and duration;
- the exact text, colors, and visual hierarchy;
- confirmation that the user owns or may use all supplied content; and
- an explicit composition ID containing only letters, numbers, and hyphens.
Ask before a costly or long-running render and before placing private data in source. Never put credentials or secrets in the entry point.
## Build the timeline
Convert time to frames before writing markup. Define scene starts and durations as integer frame constants, then verify that every scene lies within the composition duration. The first frame is `0`; the final frame is `durationInFrames - 1`.
Use these Remotion primitives consistently:
- Register a root component with `registerRoot()` and place the renderable `<Composition>` inside it.
- Give `<Composition>` explicit `id`, `component`, `durationInFrames`, `fps`, `width`, and `height` values.
- Drive all animation from `useCurrentFrame()`. Do not use CSS transitions, CSS keyframes, timers, wall-clock time, or component-mount timing.
- Read `fps` and dimensions from `useVideoConfig()` inside composition components.
- Use `<Sequence>` for scene timing. A child receives a frame relative to the Sequence start, so scene animation can begin at frame `0` without subtracting the global start.
- Use `interpolate()` for bounded numeric changes and normally clamp both extrapolation sides.
- Pass the composition `fps` to `spring()`. Tune or bound overshoot when it would make text, scale, or position leave the intended layout.
- Use Remotion's seeded `random()` when variation is necessary. Do not use `Math.random()`.
- Use `<AbsoluteFill>` for full-frame layers and make the stacking order deliberate.
Keep the entry point self-contained. Import only from the installed packages. Prefer CSS shapes, gradients, text, and inline SVG; this Action has no input for uploading supporting project files.
## Entrypoint pattern
Adapt this structure to the brief. Keep the Action's `compositionId` input identical to `COMPOSITION_ID`.
```tsx
import type { FC } from "react";
import {
AbsoluteFill,
Composition,
Sequence,
interpolate,
registerRoot,
spring,
useCurrentFrame,
useVideoConfig,
} from "remotion";
const COMPOSITION_ID = "MainVideo";
const FPS = 30;
const DURATION_IN_FRAMES = 150;
const WIDTH = 1920;
const HEIGHT = 1080;
const TitleScene: FC = () => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const opacity = interpolate(frame, [0, 12], [0, 1], {
extrapolateLeft: "clamp",
extrapolateRight: "clamp",
});
const scale = spring({
frame,
fps,
durationInFrames: 18,
config: { damping: 200 },
});
return (
<AbsoluteFill
style={{
alignItems: "center",
backgroundColor: "#101318",
color: "#ffffff",
justifyContent: "center",
}}
>
<div
style={{
fontSize: 112,
fontWeight: 700,
opacity,
transform: `scale(${scale})`,
}}
>
Clear message
</div>
</AbsoluteFill>
);
};
const MainVideo: FC = () => (
<AbsoluteFill style={{ backgroundColor: "#101318" }}>
<Sequence from={0} durationInFrames={60}>
<TitleScene />
</Sequence>
</AbsoluteFill>
);
const Root: FC = () => (
<Composition
id={COMPOSITION_ID}
component={MainVideo}
durationInFrames={DURATION_IN_FRAMES}
fps={FPS}
width={WIDTH}
height={HEIGHT}
/>
);
registerRoot(Root);
```
## Review before rendering
Check the source without executing it:
- `registerRoot()` is called and the root renders the intended `<Composition>`.
- The Action's `compositionId` exactly matches the registered composition ID.
- Every import is provided by `remotion`, `react`, `react-dom`, or `zod`.
- The frame constants, Sequence boundaries, and composition duration agree.
- Every animation is derived from the current frame and produces finite values at the first and final frames.
- Interpolations do not unintentionally extend beyond their output ranges.
- Random variation is seeded and reproducible.
- Text is legible, important content stays inside the canvas, and overlapping layers are intentional.
- The source contains no secrets, private data without confirmation, unauthorized content, or network-dependent behavior.
If any check fails, revise the entry point before spending credits on a render.
## Render and verify
Preflight the exact Action input when that surface is available. If approval is required, show the quoted cost and wait for the user's confirmation.
Call `capabilities_execute` with the exact Action name and these two inputs:
- `entryPointSource`: the complete reviewed TSX source;
- `compositionId`: the exact registered composition ID.
On success, require `exitCode` to be `0` and at least one returned asset ID. Report the asset and render duration. If a playable asset URL is returned, inspect the beginning, one or more scene boundaries, and the final frame for blank frames, clipping, flicker, unintended overlap, or truncated motion.
On failure, read `stderr`, identify a specific source or contract error, and revise only that cause. Do not retry unchanged input or loop renders speculatively.
## Official references
- [Remotion fundamentals](https://www.remotion.dev/docs/the-fundamentals)
- [Animating properties](https://www.remotion.dev/docs/animating-properties)
- [`<Composition>`](https://www.remotion.dev/docs/composition)
- [`<Sequence>`](https://www.remotion.dev/docs/sequence)
- [`interpolate()`](https://www.remotion.dev/docs/interpolate)
- [`spring()`](https://www.remotion.dev/docs/spring)
- [Deterministic `random()`](https://www.remotion.dev/docs/random)
- [Rendering](https://www.remotion.dev/docs/render)
No verified related use cases are linked yet.