vidmake v0.2.1
Download

Journal/release · motion · effectsEntry 09 / 10

What's new in vidmake 0.2

Repeat, value expressions that return strings and colors, rich text, attach, stack layout, effects and masks, particles, audio-reactive values, lint codes, --draft renders and vidmake update.

▸ blog-new-effects1280×720 · 30 fps · 0:04.0Rendered by vidmake

A day after the first release, we asked the agents that had been building videos with vidmake a simple question: what did you have to hack around? The answers were consistent. Twelve near-identical layers to draw twelve dots. Hand-computed y coordinates that broke when a headline wrapped. Counters that needed thousands separators. No way to put a cursor at the end of typed text, or make anything move with the music.

vidmake 0.2 answers that list. It also ships prebuilt binaries for Linux, macOS and Windows with one-line installers, and a vidmake update command. Everything below is additive: projects written for 0.1 validate and render unchanged.

Every demo on this page is rendered by vidmake from the JSON under it.

#Repeat

repeat stamps out copies of a layer. Each copy gets an id of <id>.<i> and two expression variables: i, the copy's index, and n, the count. Copies can sit on top of each other or be placed by a layout: radial, grid, row or column.

00:00.0 · f 000
One tick layer repeated 72 times around a circle; i and n drive the wave and the colorDownload
blog-new-repeat.jsonjson
{  "fonts": [    { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" },    { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }  ],  "compositions": [{    "id": "repeat", "description": "One tick layer repeated 72 times around a circle; i and n drive the wave and the color",    "width": 1280, "height": 720, "fps": 30, "duration": "4s",    "background": { "type": "radial", "center": [0.5, 0.5], "radius": 0.8, "stops": ["#fbf9f4", "#f4f1ea"] },    "layers": [      { "id": "tick", "type": "rect", "width": 6, "height": 46, "anchor": "bottom",        "repeat": { "count": 72, "layout": "radial", "radius": 230, "rotate": true, "delay": "12ms" },        "scaleY": "=1 + 1.1 * (0.5 + 0.5 * sin(t * tau / 2 - i * tau / n * 3))",        "fill": "=lerp('#161412', '#c92a26', 0.5 + 0.5 * sin(t * tau / 2 - i * tau / n * 3))",        "enter": { "type": "scale", "duration": "0.4s" } },      { "id": "dot", "type": "ellipse", "width": 8, "fill": "#16141255",        "repeat": { "count": 36, "layout": "radial", "radius": 160 }, "opacity": "=0.3 + 0.7 * (i % 3 == 0)" },      { "id": "count", "type": "text", "text": "72", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 140,        "letterSpacing": -6, "fill": "#161412", "y": "47%", "enter": "fadeUp" },      { "id": "label", "type": "text", "text": "copies of one layer", "font": "JetBrains Mono", "fontSize": 14, "letterSpacing": 1.7,        "uppercase": true, "fill": "#8a857a", "y": "59%", "start": "0.2s", "enter": "fadeUp" }    ]  }]}

That ring is one rect. rotate: true turns each copy to face outward, delay starts copy i at i × 12ms so the ring builds around the circle, and the wave is a single expression in which i / n is the copy's position around the ring. Repeat works on groups too, and every child of a repeated group sees the same i, which is how the next demo builds three stat tiles from one group. See repeat.

#Values that are strings and colors

In 0.1, expressions returned numbers. In 0.2 they can return strings and colors, and color fields such as fill, stroke and shadow.color accept expressions:

functionexampleresult
pick(i, [...])pick(i, ['#161412', '#1f5fb0'])the item at i, cycling
hsl(), rgb()hsl(i * 30, 80, 60)a color
lerp(c1, c2, t)lerp('#8a857a', '#c92a26', p)a blend of two colors
fmt(x)fmt(1250000)"1,250,000"
pad(x, width)pad(3, 2)"03"
+'v' + 2"v2"
00:00.0 · f 000
A repeated group of stat tiles: pick() chooses labels and colors, fmt() and pad() format the countersDownload

Each tile's label, number, accent and color come from pick(i, ...). The value counts up with fmt(round(...)), and the number's color blends from gray to its accent with lerp. One detail matters for counters: text from ${...} is now evaluated at the whole frame even when the composition has motion blur, so numbers stay sharp instead of smearing across sub-frames. There is also a per-layer "motionBlur": false for anything else that should stay crisp. See expressions.

#Rich text and attach

text can now be an array of spans. Plain strings use the layer's fill, and { "text": ..., "fill": ... } spans set their own, which is all a syntax highlighter needs. "whiteSpace": "pre" keeps indentation.

Note

Since 0.2.1, spans also take fontWeight, italic and font, so a bold keyword or an italic comment no longer needs its own layer.

attach pins a layer to a sibling. Attached to a text layer, it sits right after the last visible character, so it follows a typewriter:

00:00.0 · f 000
Rich text for syntax colors, a typewriter, a cursor attached to the last character, then the layer it describesDownload

The cursor's only position is "attach": "code", "x": 5: five pixels to the right of wherever the typing has reached. Attached to a path or line, a layer rides the drawn tip, which the data videos post uses for a marker on a line chart. See text and attach.

#Stack layout

A group with layout stacks its children like a CSS flexbox column or row, measuring each child every frame. Nothing needs a hand-computed y, and when a headline wraps to another line, everything below it moves down:

00:00.0 · f 000
A column layout re-measured every frame: when the headline wraps to more lines, everything below moves downDownload

The three headlines are separate layers with consecutive time windows. A child outside its time window takes no space, so each headline gets the slot only while it's on screen. That rule is useful, and it has a consequence worth knowing: a child that enters later makes the stack re-flow when it appears. If that's not what you want, keep the child in the stack the whole time and animate its opacity instead. The kinetic typography post shows the pattern. See groups.

#Effects and masks

Five additions, all animatable, all usable on groups:

  • glow: an additive blurred halo, in the layer's own colors or a fixed one.
  • grain: film grain on a layer, or on the whole frame with the composition's grain.
  • chromaticAberration: an RGB split in pixels.
  • rotateX, rotateY and perspective: a 3D tilt around the anchor.
  • mask and maskMode: a track matte. The mask is a full layer definition, positioned and timed like a sibling, that isn't drawn itself.
00:00.0 · f 000
A gradient seen through a text matte, tilted in 3D, with glow, chromatic aberration and film grainDownload
blog-new-effects.jsonjson
{  "fonts": [    { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" },    { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }  ],  "compositions": [{    "id": "effects", "description": "A gradient seen through a text matte, tilted in 3D, with glow, chromatic aberration and film grain",    "width": 1280, "height": 720, "fps": 30, "duration": "4s",    "background": "#131210", "grain": 0.06,    "layers": [      { "id": "plate", "type": "group", "rotateY": "=sin(t * tau / 4) * 22", "rotateX": "=6 + cos(t * tau / 4) * 6",        "children": [          { "id": "ring", "type": "arc", "width": 520, "stroke": "#efebe2", "strokeWidth": 3,            "startAngle": "=t * 90", "endAngle": "=t * 90 + 300", "glow": { "radius": 18, "strength": 2 } },          { "id": "fill", "type": "rect",            "fill": { "type": "linear", "angle": "=t * 90", "stops": [[0.3, "#efebe2"], [0.5, "#f05a4e"], [0.7, "#6aa6e8"]] },            "chromaticAberration": "=3 + 5 * pow(0.5 + 0.5 * sin(t * tau), 4)",            "mask": { "id": "word", "type": "text", "text": "0.2", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 420,              "letterSpacing": -20, "scale": { "from": 1.25, "to": 1, "duration": "1s", "ease": "easeOutCubic" } } },          { "id": "caption", "type": "text", "text": "glow · grain · chromaticAberration · rotateX/Y · mask", "font": "JetBrains Mono",            "fontSize": 16, "letterSpacing": 1, "fill": "#8f8a7f", "y": "88%" }        ] }    ]  }]}

Here a full-frame gradient rect is masked by the text 0.2, so the gradient shows only through the letters. The matte has its own scale tween, the gradient's angle rotates with time, and the whole group tilts. See effects and masks.

#Particles

The new particles layer is a seeded emitter. Like everything else in vidmake, particle positions are computed from time and a seed rather than simulated frame by frame, so any frame renders on its own and a render is reproducible.

00:00.0 · f 000
Two seeded emitters: embers rising from the bottom edge and a burst of stars behind the titleDownload
blog-new-particles.jsonjson
{  "fonts": [{ "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }],  "compositions": [{    "id": "particles", "description": "Two seeded emitters: embers rising from the bottom edge and a burst of stars behind the title",    "width": 1280, "height": 720, "fps": 30, "duration": "4s",    "background": { "type": "radial", "center": [0.5, 1], "radius": 1.1, "stops": ["#1d1b18", "#131210"] },    "layers": [      { "id": "embers", "type": "particles", "x": "50%", "y": 712, "width": 1280, "start": "-3s",        "emitter": { "rate": 60, "lifetime": "3.5s", "speed": 210, "speedRandom": 0.6, "angle": 0, "spread": 24,          "gravity": -12, "drag": 0.1, "size": 9, "endSize": 2, "colors": ["#efebe2", "#8f8a7f", "#f05a4e"] },        "glow": { "radius": 8, "strength": 1.2 } },      { "id": "burst", "type": "particles", "x": "50%", "y": "46%", "start": "0.8s", "duration": "3.2s",        "emitter": { "burst": 140, "rate": 0, "lifetime": "2.4s", "speed": 900, "speedRandom": 0.85, "gravity": 220,          "drag": 1.6, "size": 18, "endSize": 4, "shape": "star", "spin": 300, "seed": 7,          "colors": ["#efebe2", "#6aa6e8", "#f05a4e", "#8f8a7f"] } },      { "id": "title", "type": "text", "text": "Same seed, same sparks.", "font": "Schibsted Grotesk", "fontWeight": 860,        "fontSize": 80, "letterSpacing": -3.5, "fill": "#efebe2", "y": "46%", "start": "0.8s", "enter": "pop",        "shadow": { "color": "#131210cc", "blur": 30 } },      { "id": "sub", "type": "text", "text": "Particles are a pure function of time, like everything else.", "font": "Schibsted Grotesk",        "fontSize": 22, "fill": "#8f8a7f", "y": "60%", "start": "1.2s", "enter": "fadeUp" }    ]  }]}

Two tips from building this one. First, the embers layer starts at "-3s", so it has been emitting for three seconds when the video begins and the frame is already full at frame 0. Second, the linter checks the emitter's box, not where the particles fly. An emitter placed just below the frame would be reported as off-canvas even though its particles are visible:

output
warning: layer `embers` is entirely off-canvas at frame 60 (bbox [0,740,1280,740]) [offCanvas]

The fix is either to move the emitter onto the canvas, as this demo does with "y": 712, or to say the placement is intended with "lint": { "ignore": ["offCanvas"] }. See particles.

#Audio-reactive values

Four new expression variables come from the composition's soundtrack: amp (loudness, 0 to 1), bass (the low end, 0 to 1), beat (1 on each detected beat, decaying within about 0.3 seconds) and beats (the number of beats so far). They are computed from everything audible in the composition (audio layers and video sound, after volume and fades), and only when an expression actually uses them.

00:00.0 · f 000
beat drives a ripple and a pulse, beats picks the color, bass sets the bar width (sound on)Download
blog-new-beat.jsonjson
{  "fonts": [    { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" },    { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }  ],  "compositions": [{    "id": "beat", "description": "beat drives a ripple and a pulse, beats picks the color, bass sets the bar width (sound on)",    "width": 1280, "height": 720, "fps": 30, "duration": "4s",    "background": "#f4f1ea",    "layers": [      { "id": "music", "type": "audio", "src": "assets/music.mp3" },      { "id": "ripple", "type": "ellipse", "width": "=240 + 900 * pow(1 - beat, 2)", "height": "=240 + 900 * pow(1 - beat, 2)",        "fill": null,        "stroke": "=pick(beats, ['#161412', '#c92a26', '#1f5fb0'])", "strokeWidth": "=1 + 6 * beat",        "opacity": "=beat", "lint": { "ignore": ["invisible"] } },      { "id": "word", "type": "text", "text": "on the beat", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 140,        "letterSpacing": -6, "scale": "=1 + 0.1 * beat",        "fill": "=lerp('#161412', pick(beats, ['#161412', '#c92a26', '#1f5fb0']), beat)" },      { "id": "bass", "type": "rect", "y": "68%", "height": 6, "width": "=24 + 560 * bass", "fill": "#161412" },      { "id": "count", "type": "text", "text": "beats ${pad(beats, 2)}   bass ${bass:2}", "font": "JetBrains Mono",        "fontSize": 15, "letterSpacing": 1.8, "uppercase": true, "fill": "#8a857a", "y": "76%" }    ]  }]}

The ripple's size is 240 + 900 * pow(1 - beat, 2), so it starts small on each beat and expands as beat decays. pick(beats, [...]) advances the color on every beat. Audio-reactive visuals goes deeper, and the reference is in audio-reactive.

#Tooling

#Lint codes

The layout and timing warnings from validate now end with a code: offCanvas, textOverflow, invisible, zeroDuration or afterEnd. Intended warnings, such as rays that fly off-screen or a blinking cursor that is invisible half the time, can be silenced per layer, and a group's setting covers its children:

json
{ "id": "cursor", "type": "rect", "attach": "typed", "opacity": "=fract(t * 1.6) < 0.5 ? 1 : 0",  "lint": { "ignore": ["invisible"] } }

"lint": false silences everything for that layer. A clean validate now means something, which matters for agents that treat any warning as a reason to look again. See lint.

#Draft renders

vidmake render --draft renders a full-length preview at half size, without motion blur, using the fastest encoder preset. Here is the 4-second title card from our introduction, rendered both ways on the same laptop (only the final done event of each is shown):

output
$ vidmake render blog-intro-first.json -o out/first.mp4 --json{"event":"done","output":"out/first.mp4","codec":"h264","frames":120,"width":1280,"height":720,"fps":30.0,"duration":4.0,"elapsed":2.462749207,"renderFps":48.726033352855325,"draft":false}$ vidmake render blog-intro-first.json -o out/first-draft.mp4 --json --draft{"event":"done","output":"out/first-draft.mp4","codec":"h264","frames":120,"width":640,"height":360,"fps":30.0,"duration":4.0,"elapsed":0.458601718,"renderFps":261.6649595717389,"draft":true}

The draft finished about five times sooner. It's the right render for checking pacing and audio sync; the full render is for the file you ship. Progress events (--json) now also carry percent and eta.

#Schema, update, installers

  • vidmake schema prints a JSON Schema for project files. Point an editor at it, or validate generated JSON against it before calling the CLI at all. The site serves it at /schema.json.
  • vidmake update installs the newest release by reinstalling with cargo install (so it needs a Rust toolchain), and vidmake update --check only reports whether there is one. vidmake also checks for a new release at most once a day: on a terminal it asks, otherwise it prints a single note: line to stderr and leaves stdout and --json output untouched. VIDMAKE_NO_UPDATE_CHECK=1 turns the check off, and it's skipped when CI is set.
  • Every push to main now builds Linux (x86_64 and arm64), macOS (Intel and Apple Silicon) and Windows binaries, and install.sh and install.ps1 put the right one on your PATH. See installation.

#Upgrading

Run vidmake update, or re-run the installer. Then run vidmake validate --all on your projects. Nothing that worked in 0.1 should break, but the new lint may tell you about things that were already wrong.

If you drive vidmake from an agent, re-read vidmake docs once after updating. The reference now covers repeat, attach, effects and lint, and an agent that knows repeat exists will stop writing twelve copies of the same layer. The complete list of features in one project is examples/features.json, in the examples folder of the release archive.

View .md Ask Claude Ask ChatGPT

Keep reading

showcasemotion

Four reels, thirty seconds each

A Swiss poster, a piece of generative op-art, a data poem and a risograph collage. Each is a single vidmake JSON file, written, checked and rendered by an agent, using nothing but the four stock assets.

Read

releasemotion

What's new in vidmake 0.5

Markers name the beats of a video, decoration draws underlines, strike-throughs and highlights from the glyphs, design tokens and named easings bring a brand's system into a project, and WOFF2 fonts, synthetic italics, skewX, themed SVG icons, repeat origins and wipe edges close the gaps an agent hit making a 20-second ad.

Read

releaseaudio

What's new in vidmake 0.2.1

vidmake analyze shows the beats and loudness curves that audio-reactive expressions will see, rich-text spans take fontWeight, italic and font, drawMode: "total" draws many strokes with one pen, and source builds report the right version.

Read