A composition is one canvas: a size, a frame rate, a duration and a stack of layers. A project file holds one or more of them. This page covers the project file and every composition field; layers have their own pages.
#The project file
{ "fonts": [ { "family": "Brand", "path": "fonts/Brand-Regular.ttf" }, { "family": "Brand", "path": "fonts/Brand-Bold.ttf" } ], "compositions": [ { "id": "main", "width": 1920, "height": 1080, "fps": 30, "duration": "10s", "layers": [] } ]}| key | type | notes |
|---|---|---|
compositions | composition[] | required. The first one is the default for every command |
fonts | { family, path }[] | font files to load in addition to the system fonts (see Fonts) |
theme | object or file path | design tokens every composition reads as "$color.accent": colors, type styles, motion, layer styles and modes; see theme |
$schema | string | optional, for editors; see JSON Schema |
All file paths in a project (fonts[].path, layer src) are relative to the project file, not to the
directory you run vidmake from. Absolute paths work too.
#A single composition
For a quick one-off, the file can be a single composition object with layers and no compositions
wrapper. Its id defaults to main:
{ "width": 1280, "height": 720, "duration": "3s", "background": "#f4f1ea", "layers": [{ "id": "hello", "type": "text", "text": "Hello", "fontSize": 96, "fill": "#161412" }] }Warning
A bare composition can't declare
fonts(that key belongs to the project wrapper), and editing it withvidmake set,add,unsetorrmsaves it back in the full{ "compositions": [...] }form. Use the full form for anything you plan to keep.
#Fonts
Text layers find fonts by family name. vidmake loads every font installed on the system, plus the files
listed in fonts:
"fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk-Italic.ttf" }, { "path": "fonts/JetBrainsMono.ttf" }]familyis the name text layers use in"font". It is matched case-insensitively, and it doesn't have to match the name inside the file, so you can call a font"Brand".- List several files under one family to provide weights and italics; a text layer's
fontWeightanditalicpick the closest face. - Without
family, the font is registered under the name stored in the file. Runvidmake fonts --project project.jsonto see it. serif,sans-serifandmonospacealways resolve to an installed font..ttf,.otf,.ttc,.woffand.woff2files all load; web fonts need no conversion.
A missing font file stops every command with error: font ./fonts/Brand-Bold.ttf: No such file or directory (os error 2).
A text layer asking for a family that doesn't exist fails validation with
font family `Brand` not found. Add it to the project's `fonts` list or run `vidmake fonts` to see installed families.
Tip
Ship font files next to the project and declare them. The video then renders identically on every machine, instead of depending on what happens to be installed.
#Composition fields
| field | type | default | notes |
|---|---|---|---|
id | string | required (main in a bare file) | referenced by --comp, use layers and edit paths like main.fps |
width, height | integer | required | pixels, greater than 0. Use even numbers for H.264/H.265 |
fps | number | 30 | frames per second, greater than 0. Fractional rates like 29.97 work |
duration | time or "auto" | "auto" | see Duration |
background | paint | transparent | a color, gradient or animated color; see Background |
layers | layer[] | [] | drawn in order: first = bottom, last = top |
props | object | {} | default input props for {{name}} placeholders; see Props |
markers | object | {} | named times like {"build": "8.5s"}, used as "@build" and since('build'); see Markers |
motionBlur | { samples, shutter } | off | camera motion blur; see Motion blur |
grain | 0..1 | 0 | film grain over the finished frame |
description | string | free text, shown by vidmake list |
Unknown fields are errors, with a suggestion: composition `main`: unknown field `motionblur` — did you mean `motionBlur`?.
Validation also warns when the size is odd, because H.264 and H.265 need even dimensions.
#Duration
duration takes any time value: 300 (frames), "10s", "1:30". The final frame count is
rounded to a whole frame.
"auto", the default, measures the content: the composition lasts until the latest end of any layer
with a fixed length. A layer has a fixed length when it has:
- an explicit
durationorend, - media: a
videooraudiolayer's remaining length (aftertrimStart, divided byplaybackRate), unless it has"loop": true, - a series: a
seriesgroup's total length, - a component: a
uselayer's referenced composition length, - captions: the end of the last caption,
- or it is a group containing any of the above (offset by the group's
start).
Layers without a fixed length (a background rect, a looping animation) simply fill whatever duration
results. If nothing has a fixed length, validation fails with
could not infer a duration (no layer has a fixed length). Set `duration`, e.g. "duration": "5s".
{ "id": "auto", "width": 1280, "height": 720, "layers": [ { "id": "bg", "type": "rect", "fill": "#f4f1ea" }, { "id": "clip", "type": "video", "src": "assets/clip.mp4", "trimStart": "2s" }, { "id": "outro", "type": "text", "text": "Thanks", "fill": "#161412", "start": "4s", "duration": "1.5s" } ] }Here the clip lasts 4 seconds (6 minus 2) and the outro ends at 5.5 seconds, so the composition is 5.5
seconds long and bg fills all of it. Change the outro and the duration follows. vidmake list shows
duration="auto"; validate and timeline print the resolved length.
#Background
background is a paint drawn under every layer: a color ("#f4f1ea"), a
gradient or an animated color like [[0, "#f4f1ea"], ["5s", "#e9e4d8"]].
"background": { "type": "radial", "center": [0.5, 0.4], "radius": 0.9, "stops": ["#f4f1ea", "#e9e4d8"] }Without background the composition is transparent. Formats with alpha keep the transparency: WebM
(VP9), MOV (ProRes 4444), GIF and PNG sequences. MP4 has no alpha channel, so transparent areas come out
black. A full-size rect as the first layer does the same job as background, but can be animated,
blurred and masked like any layer.
#Motion blur
"motionBlur": { "samples": 12, "shutter": 1 }Camera motion blur, like Remotion's <CameraMotionBlur>. Each output frame is the average of samples
renders spread evenly over the shutter frames leading up to it, so anything that moves fast leaves a
trail.
| field | default | notes |
|---|---|---|
samples | 6 | sub-frames per frame. 1 means no blur. Render time grows with the number of samples |
shutter | 0.5 | how long the virtual shutter is open, in frames. 1 blurs over a full frame interval |
"motionBlur": {} uses both defaults. Set "motionBlur": false on a single layer to render it at the
exact frame, which keeps text and UI elements crisp while the rest of the frame blurs. render --draft
turns motion blur off for a fast preview; still and storyboard include it.
{ "fonts": [{ "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }], "compositions": [{ "id": "blur", "description": "Composition motionBlur and grain; the lower bar opts out with motionBlur: false", "width": 1280, "height": 720, "fps": 30, "duration": "3s", "background": { "type": "linear", "angle": 180, "stops": ["#f4f1ea", "#e9e4d8"] }, "motionBlur": { "samples": 16, "shutter": 1 }, "grain": 0.06, "layers": [ { "id": "blurred", "type": "rect", "y": "36%", "width": 160, "height": 110, "cornerRadius": 3, "fill": "#c92a26", "x": { "keys": [[0, 200], ["1.5s", 1080, "easeInOutQuart"]], "repeat": "pingpong" } }, { "id": "sharp", "type": "rect", "y": "66%", "width": 160, "height": 110, "cornerRadius": 3, "fill": "#161412", "motionBlur": false, "x": { "keys": [[0, 200], ["1.5s", 1080, "easeInOutQuart"]], "repeat": "pingpong" } }, { "id": "labelBlur", "type": "text", "text": "motionBlur: { samples: 16, shutter: 1 }", "font": "JetBrains Mono", "fontSize": 20, "fill": "#4a4640", "y": "22%" }, { "id": "labelSharp", "type": "text", "text": "layer \"motionBlur\": false", "font": "JetBrains Mono", "fontSize": 20, "fill": "#4a4640", "y": "80%" } ] }]}#Grain
"grain": 0.06 adds monochrome film grain over the finished frame. The pattern changes every frame (it
is seeded by the frame number, so renders stay reproducible). Values are clamped to 0..1; 0.03 to 0.1 is a
subtle range. A layer's own grain field applies grain to just that layer (Effects).
#Description
description is free text for people and agents reading the project. vidmake list prints it under each
composition, which makes it a good place to document a component's props.
#Multiple compositions
A project can hold several compositions. Common reasons:
- Formats: a 16:9 and a 9:16 cut of the same video.
- Components: a lower third or a title card used by other compositions through
uselayers. - Separate deliverables: an intro, a teaser and the full video that share fonts and assets.
{ "fonts": [ { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }, { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" } ], "compositions": [ { "id": "landscape", "description": "One project, three compositions: a 16:9 cut and a 9:16 cut share a title component", "width": 1280, "height": 720, "fps": 30, "background": "#f4f1ea", "layers": [ { "id": "title", "type": "use", "ref": "title", "props": { "headline": "Autumn release" } }, { "id": "format", "type": "text", "text": "landscape · 1280×720", "font": "JetBrains Mono", "fontSize": 18, "letterSpacing": 2.2, "uppercase": true, "fill": "#8a857a", "y": "88%", "enter": "fade" } ] }, { "id": "vertical", "width": 720, "height": 1280, "fps": 30, "background": "#f4f1ea", "layers": [ { "id": "title", "type": "use", "ref": "title", "scale": 0.72, "y": "42%", "props": { "headline": "Autumn release" } }, { "id": "format", "type": "text", "text": "vertical · 720×1280", "font": "JetBrains Mono", "fontSize": 22, "letterSpacing": 2.6, "uppercase": true, "fill": "#8a857a", "y": "88%", "enter": "fade" } ] }, { "id": "title", "description": "Reusable title: a headline and a red rule", "width": 960, "height": 300, "duration": "3s", "props": { "headline": "Headline" }, "layers": [ { "id": "headline", "type": "text", "text": "{{headline}}", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 112, "letterSpacing": -5, "fill": "#161412", "y": "42%", "stagger": { "by": "char", "type": "fadeUp", "each": "30ms" }, "exit": "fade" }, { "id": "rule", "type": "line", "points": [[0, 0], [420, 0]], "y": "82%", "stroke": "#c92a26", "strokeWidth": 4, "drawEnd": { "from": 0, "to": 1, "start": "0.4s", "duration": "0.8s", "ease": "easeOutCubic" }, "exit": "fade" } ] } ]}vidmake list shows what a project contains:
$ vidmake list comp-formats.json
landscape 1280x720 @30fps duration="auto" layers=2 props={}
One project, three compositions: a 16:9 cut and a 9:16 cut share a title component
vertical 720x1280 @30fps duration="auto" layers=2 props={}
title 960x300 @30fps duration="3s" layers=2 props={"headline":"Headline"}
Reusable title: a headline and a red ruleEvery command that takes a project works on the first composition unless you pass --comp <id>
(short -c): validate, timeline, inspect, trace, still, storyboard and render. Here is the
vertical cut of the demo above:
vidmake storyboard comp-formats.json --comp vertical --at 0.3s,1.5s,2.9s --cols 3vidmake render comp-formats.json --comp vertical -o out/vertical.mp4
vidmake validate --all checks every composition, including components that are only used through
use:
$ vidmake validate comp-formats.json --all
✓ landscape — 90 frames (3.00s)
✓ vertical — 90 frames (3.00s)
✓ title — 90 frames (3.00s)An unknown id lists the ones that exist: error: no composition `square`. Available: landscape, vertical, title.
Tip
Put the composition you render most often first, and components after it.
vidmake add --comp <id>adds layers to a composition other than the first.
#Editing composition fields
Composition fields are addressed by id in get, set and unset:
vidmake get project.json main.durationvidmake set project.json main.duration '"8s"'vidmake set project.json main.background '"#fbf9f4"'vidmake set project.json main.motionBlur '{"samples": 8, "shutter": 0.5}'vidmake unset project.json main.grainSee Editing for paths and the other edit commands.