Skip to main content
compose renders a video from a JSON timeline. Start with one clip, then layer up: more clips, transitions, overlays, and effects. This page builds from the smallest render to the full model. Each step adds one idea.

Your simplest render

The smallest timeline is one track with one clip. This trims three seconds of a video and renders it to MP4. The whole API call:
Assets: video, image, text, audio, composition · Output: mp4 / webm / gif / mp3 (audio only) / jpg / png (still frame)
That is the shape of every render. Everything below is one more clip, one more track, or one more field.

Join two clips

Put a second clip on the same track and a transition between them. The clips overlap by the transition’s duration, so the second clip starts a little before the first ends.
slide also accepts direction: "left" | "right" | "up" | "down".

crossfade

fade

slide (left)

zoom

How the timeline works

The model is two ideas:
  • Tracks stack. The first track is the background. Each later track composites on top of the ones below it: overlays, titles, picture-in-picture.
  • Clips sit in time. Each clip has a start and a length in seconds. Two clips on the same track are joined by a transition. A gap between them plays nothing.
So a multi-track timeline is layers (tracks) of sequences (clips). That is the whole structure.

Add a layer

A second track renders over the first. This lays an animated title over the video.

Effects on a clip

Any clip takes effects as fields. Add one field at a time, on the clip it applies to.

Color grade

color grades a clip. Set contrast, saturation, temperature, brightness, and gamma to set a cinematic mood, or push them to lift flat, hazy footage.

Cinematic color grade to set a mood

Filters

filter applies a one-shot look: greyscale, negative, boost, muted, lighten, darken, or contrast.

Transform and Ken Burns

transform positions and scales a clip. Add animateTo and it animates from the start values to the end values over the clip, the Ken Burns move that brings a still photo to life.

Bring a still photo to life for slideshows and docs

Picture-in-picture

Scale a clip down and position it on an overlay track to put a webcam over your content, for reactions and screen-shares.

Speed

speed is a multiplier. Below 1 slows a clip down for a dramatic action beat, above 1 speeds a slow process into a timelapse.

Chroma key

chromaKey removes a solid background color so you can drop a presenter onto any scene. Put the keyed clip on an overlay track above the new background.

Put a presenter on any background (chroma key)

Blend modes

blendMode controls how an overlay composites with the track below: screen, multiply, overlay, add, and more. A light-leak clip over your footage with screen adds a cinematic glow.

Opacity and blur

opacity takes a number or keyframes. Keyframe it from 0 to 1 and back for a clean fade in and out. blur softens a clip, useful as a backdrop that keeps overlaid text readable.

Text and titles

A text asset renders a styled title. Set the font, size, weight, color, position, and an animate entrance (fade, slideUp, slideDown, slideLeft, slideRight). Put one text clip on its own track for a title card, another low and left for a lower-third name tag.

Add a title card and a lower-third name tag (text)

Set the canvas

output controls the resolution, frame rate, and format. A 9:16 canvas with a crop on the clip turns landscape footage into a vertical Reel that fills the frame, no black bars.

Landscape footage reframed to a vertical 9:16 Reel (crop)

Scene-first authoring

Tracks give you precise multi-track control. For a sequential edit, you can instead describe a list of scenes. Each scene is a self-contained segment with its own clips and an optional transition into the next. overlays is a flat list of clips that sit over the whole composition, like a persistent logo or watermark.
A scene’s clips can omit start and length to span the whole scene. Every clip field works the same as in tracks mode. scenes and tracks are mutually exclusive: a timeline uses one or the other.

Reference

Output

The output object controls the render target.

Assets

A clip’s asset is one of:

Clip fields

Every clip has asset, start, length, plus any of:

Transitions

A track item { "type": "transition", "transition": <kind>, "duration": <seconds>, "direction"?: <dir> }: crossfade, fade, slide (direction: left / right / up / down), zoom, none (hard cut).

Text style

Fields on a text asset’s style: font, size, weight (100..1000), color, align (left / center / right), position {x,y}, stroke {color,width}, background, shadow {color,opacity,offsetX,offsetY}, animate {type: fade \| slideUp \| slideDown \| slideLeft \| slideRight, duration}.