This page takes you from an empty folder to a rendered MP4. It assumes the vidmake app is
installed and the vidmake command is on your PATH (Installation).
- Create a starter project with
vidmake init. - Read the JSON it wrote.
- Check it with
validateandtimeline. - Look at it with
storyboard. - Edit it with
vidmake set. - Render it with
vidmake render.
#1. Create a project
vidmake init my-videocreated my-video/project.jsonnext: vidmake validate my-video/project.json vidmake storyboard my-video/project.json -o storyboard.png vidmake render my-video/project.json -o out/video.mp4init creates the folder, an empty assets/ folder for your media, and project.json. It never
overwrites: if project.json already exists it stops with error: my-video/project.json already exists.
Use --name other.json to pick a different file name, or vidmake init with no argument to create
project.json in the current folder.
The rest of this page runs commands inside the project folder:
cd my-video#2. Read the project
project.json is a working example: an animated title card with a subtitle, a progress ring and a
counter. It needs no media files.
{ "compositions": [ { "id": "main", "description": "Starter: animated title card with a counter and a progress ring", "width": 1920, "height": 1080, "fps": 30, "duration": "5s", "props": { "title": "Hello, vidmake", "subtitle": "Videos from JSON", "accent": "#c92a26" }, "background": { "type": "linear", "angle": 135, "stops": ["#f4f1ea", "#e9e4d8"] }, "layers": [ { "id": "glow", "type": "ellipse", "width": 900, "height": 900, "fill": { "type": "radial", "stops": ["{{accent}}1f", "{{accent}}00"] }, "x": "=w/2 + sin(t*0.8)*200", "y": "=h/2 + cos(t*0.6)*80", "blur": 40 }, { "id": "title", "type": "text", "text": "{{title}}", "font": "sans-serif", "fontWeight": 900, "fontSize": 120, "letterSpacing": -5, "y": "42%", "fill": "#161412", "enter": { "from": { "opacity": 0, "y": "0.3em", "blur": "0.1em" } }, "stagger": "char", "exit": "fade" }, { "id": "subtitle", "type": "text", "text": "{{subtitle}}", "fontSize": 48, "y": "56%", "fill": "#4a4640", "start": "0.6s", "enter": "fadeUp", "exit": "fade" }, { "id": "ring", "type": "arc", "x": "50%", "y": "78%", "width": 120, "height": 120, "stroke": "{{accent}}", "strokeWidth": 12, "startAngle": 0, "endAngle": { "from": 0, "to": 360, "duration": "3.5s", "ease": "easeInOutCubic" }, "start": "1s", "enter": "pop" }, { "id": "counter", "type": "text", "text": "${round(map(t, 0, 3.5, 0, 100))}%", "fontSize": 32, "fontWeight": 700, "x": "50%", "y": "78%", "start": "1s", "fill": "#161412" } ] } ]}What each part does:
| part | meaning |
|---|---|
compositions | a project holds one or more compositions; the first one is rendered by default |
width, height, fps, duration | a 1920×1080 canvas at 30 frames per second, 5 seconds long (time values) |
props | default input props, used below as {{title}}, {{subtitle}} and {{accent}} |
background | a diagonal linear gradient behind everything |
layers | drawn in order: glow at the bottom, counter on top |
"x": "=w/2 + sin(t*0.8)*200" | an expression, evaluated every frame; t is the layer's time in seconds |
"y": "42%" | a percentage of the parent's height; layers are centered on x/y by default (concepts) |
stagger | plays the title's enter letter by letter: each one rises and comes into focus (text) |
enter, exit | animate a layer in from a state at its start and out at its end, by name (fadeUp) or as a state (presets) |
endAngle tween | a tween from 0 to 360 degrees over 3.5 seconds draws the ring |
"text": "${...}%" | live text: the counter counts from 0 to 100 |
"start": "1s" | the ring and counter appear one second in; their animation times count from there |
Tip
The same file ships in the
examplesfolder of every release archive asexamples/starter.json, so the command output below runs on that copy. Yourmy-video/project.jsongives identical results.
#3. Check it
validate compiles the project, checks fonts, assets and expressions, and lints the layout. A ✓ with no
warnings means it is ready to render:
$ vidmake validate examples/starter.json
✓ main — 150 frames (5.00s)timeline shows when each layer is on screen. The bars confirm that subtitle comes in at 0.6 s and
ring and counter at 1 s:
$ vidmake timeline examples/starter.json
Composition `main` — 1920x1080 @ 30fps, 150 frames (5.00s)
ID TYPE START END DUR DETAILS
glow ellipse 0.00s 5.00s 5.00s
title text 0.00s 5.00s 5.00s enter:custom per unit exit:fade "Hello, vidmake"
subtitle text 0.60s 5.00s 4.40s enter:fadeUp exit:fade "Videos from JSON"
ring arc 1.00s 5.00s 4.00s enter:pop
counter text 1.00s 5.00s 4.00s "0%"
|0s 1s 2s 3s 4s |
glow |████████████████████████████████████████████████████████████|
title |████████████████████████████████████████████████████████████|
subtitle |·······█████████████████████████████████████████████████████|
ring |············████████████████████████████████████████████████|
counter |············████████████████████████████████████████████████|#4. Look at it
A storyboard renders evenly spaced frames into one labeled image. This is the fastest way to see the whole video:
vidmake storyboard project.json -o storyboard.png -n 6 --cols 3
To check exact numbers, inspect lists every visible layer at one moment with its resolved position,
size, opacity and bounding box:
$ vidmake inspect examples/starter.json -t 2s
Frame 60 (2.00s) of `main` (1920x1080), 5 visible layer(s), drawn bottom→top:
ID TYPE X Y W H ROT SCALE OPAC BBOX [x0,y0,x1,y1] NOTES
glow ellipse 1159.9 569.0 900.0 900.0 0.0 1.00 1.00 [710,119,1610,1019]
title text 960.0 453.6 780.4 144.0 0.0 1.00 1.00 [570,382,1350,526] "Hello, vidmake"
subtitle text 960.0 604.8 396.6 57.6 0.0 1.00 1.00 [762,576,1158,634] "Videos from JSON"
ring arc 960.0 842.4 120.0 120.0 0.0 1.00 1.00 [900,782,1020,902]
counter text 960.0 842.4 64.0 38.4 0.0 1.00 1.00 [928,823,992,862] "29%"For a full-resolution frame, use vidmake still project.json -t 2s -o frame.png.
#5. Edit it
Change the title and accent color without opening an editor. set takes a path (a layer or composition
id followed by fields) and a JSON value; a plain string can skip the inner quotes:
vidmake set project.json main.props.title "Launch day"vidmake set project.json main.props.accent '"#1f5fb0"'set /compositions/0/props/titleset /compositions/0/props/accentEvery edit is compiled before it is saved. A mistake is rejected and the file is left as it was:
vidmake set project.json subtitle.enter '"fadeup"'error: edit not saved, the project would be invalid: layer `subtitle` (main > layers[2]): `enter`: unknown preset `fadeup`. Available: fade, fadeUp|Down|Left|Right (fade + short move), slideUp|Down|Left|Right (from off the parent), rise (text: up from behind its line), scale, pop (bouncy), zoom, blur, rotate, wipeLeft|Right|Up|Down, typewriter (text)(use --force to save anyway)vidmake get project.json main.props reads values back. See Editing for add, rm and
unset. Larger changes are easiest in the JSON itself; run validate again afterwards.
Note
setsaves the file with standard two-space JSON formatting, so hand-made line breaks are not kept.
#6. Render it
Render a quick draft first: no motion blur, half resolution and the fastest encoder settings.
vidmake render project.json -o out/draft.mp4 --draftThen the final file:
vidmake render project.json -o out/video.mp4rendering 150/150 frames (13.7 fps, 0s left){"event":"done","output":"out/video.mp4","codec":"h264","frames":150,"width":1920,"height":1080,"fps":30.0,"duration":5.0,"elapsed":11.582925707,"renderFps":12.950096011524042,"draft":false}Progress goes to stderr; the last line on stdout is a JSON done event with the output path, size and
timing. Add --json to get progress as JSON lines too. The output format follows the file extension:
.webm, .mov, .gif, .mp3 and more are covered in Rendering.
Here is the result, with the two edits applied:
{ "compositions": [ { "id": "main", "description": "The starter project after two edits: a new title and accent color", "width": 1920, "height": 1080, "fps": 30, "duration": "5s", "props": { "title": "Launch day", "subtitle": "Videos from JSON", "accent": "#1f5fb0" }, "background": { "type": "linear", "angle": 135, "stops": ["#f4f1ea", "#e9e4d8"] }, "layers": [ { "id": "glow", "type": "ellipse", "width": 900, "height": 900, "fill": { "type": "radial", "stops": ["{{accent}}1f", "{{accent}}00"] }, "x": "=w/2 + sin(t*0.8)*200", "y": "=h/2 + cos(t*0.6)*80", "blur": 40 }, { "id": "title", "type": "text", "text": "{{title}}", "font": "sans-serif", "fontWeight": 900, "fontSize": 120, "letterSpacing": -5, "y": "42%", "fill": "#161412", "enter": { "from": { "opacity": 0, "y": "0.3em", "blur": "0.1em" } }, "stagger": "char", "exit": "fade" }, { "id": "subtitle", "type": "text", "text": "{{subtitle}}", "fontSize": 48, "y": "56%", "fill": "#4a4640", "start": "0.6s", "enter": "fadeUp", "exit": "fade" }, { "id": "ring", "type": "arc", "x": "50%", "y": "78%", "width": 120, "height": 120, "stroke": "{{accent}}", "strokeWidth": 12, "startAngle": 0, "endAngle": { "from": 0, "to": 360, "duration": "3.5s", "ease": "easeInOutCubic" }, "start": "1s", "enter": "pop" }, { "id": "counter", "type": "text", "text": "${round(map(t, 0, 3.5, 0, 100))}%", "fontSize": 32, "fontWeight": 700, "x": "50%", "y": "78%", "start": "1s", "fill": "#161412" } ] } ]}#Try it with props instead
The title and accent are props, so you can also override them per render without editing the file:
vidmake render project.json -o out/hello.mp4 -p title="Hello again" -p accent="#161412"That is how one project becomes many videos. Props covers the details.