# Troubleshooting

> Fixes for the problems people hit most, from a missing ffmpeg, missing fonts and odd dimensions to transparency, missing audio and slow renders, plus what the common `validate` errors mean, licensing and the update check.

Start with `vidmake validate project.json --all`. Most problems are reported there with the composition, layer,
position in the file and field. The sections below cover what's left.

## ffmpeg not found

```output
error: ffmpeg not found on PATH. vidmake uses macOS's own frameworks for video and sound, but VP9/WebM and MP3 output (and VIDMAKE_MEDIA=ffmpeg) need ffmpeg: install it (`brew install ffmpeg`) or set VIDMAKE_FFMPEG
```

vidmake reads and writes video and sound with macOS's own AVFoundation and VideoToolbox, so it needs nothing
installed for MP4, MOV, GIF, PNG sequences, WAV and M4A. When ffmpeg is installed, vidmake uses it instead (set
`VIDMAKE_MEDIA=native` to keep the system frameworks anyway). You see this error when:

- you render VP9/WebM (`-o video.webm`) or MP3: macOS has no encoder for them. Install ffmpeg (`brew install ffmpeg`), or
  pick another format;
- `VIDMAKE_MEDIA=ffmpeg` is set and ffmpeg isn't installed: unset it;
- `VIDMAKE_FFMPEG` or `VIDMAKE_FFPROBE` points at a file that isn't there: unset it, or fix the path.

`vidmake hardware` says which engine is in use, and every render's `done` event (`--json`) names it.

**Unknown encoder.** If ffmpeg fails with `Unknown encoder 'libx264'` (or `libx265`, `libvpx-vp9`, `libopus`,
`libmp3lame`), the installed ffmpeg lacks that codec. Install a full build (Homebrew's has them all), set
`VIDMAKE_MEDIA=native` for formats macOS can write, or render to a format whose encoder you have (`ffmpeg -encoders`
lists them).

## Fonts missing

```output
✗ main: layer `title` (main > layers[0]): font family `Helvetica Neue` not found. Add it to the project's `fonts` list or run `vidmake fonts` to see installed families
```

The `font` field takes a family name that is either installed on the machine, declared in the project's `fonts`
list, or one of the generic names `sans-serif`, `serif`, `monospace`.

- **List what's available:** `vidmake fonts` (all families), `vidmake fonts inter` (filter), `vidmake fonts
  --project project.json` (including the project's own). See [fonts](https://vidmake.app/docs/inspecting.md#fonts).
- **Ship the font with the project** (recommended, so it renders the same on every machine):
  ```json
  "fonts": [
    { "family": "Brand", "path": "fonts/Brand-Regular.ttf" },
    { "family": "Brand", "path": "fonts/Brand-Bold.ttf" },
    { "family": "Brand", "path": "fonts/Brand-Italic.ttf" }
  ]
  ```
  Paths are relative to the project file. Give every file of a family the same `family` name; vidmake picks the
  file closest to the requested `fontWeight` and `italic`.
- **Case matters for installed fonts:** `"font": "Inter"` works where `"font": "inter"` doesn't. Families declared
  in `fonts` match case-insensitively.
- **Missing glyphs** (emoji, CJK, symbols) fall back to other installed fonts (DejaVu Sans, Noto Sans, Arial,
  Segoe UI, ...). If a character renders as a box, add a font that has it.
- A font file that can't be read fails with `font <path>: ...`; a file with no usable faces (e.g. a WOFF2 web font)
  with `font <path> contained no usable faces`. Use `.ttf` or `.otf`.

## Odd dimensions with H.264

```output
✓ main — 30 frames (1.00s)
  warning: composition size 641x360 is odd; H.264/H.265 need even dimensions
```

```output
error: ffmpeg stopped accepting frames (Broken pipe (os error 32)): [libx264 @ 0x555e2a733a40] width not divisible by 2 (641x360)
```

H.264 and H.265 with 4:2:0 chroma need even width and height. Use even numbers in the composition (1920×1080,
1080×1920, 1280×720). Renders at a `--scale` other than 1 are bumped to even sizes automatically, and WebM, ProRes,
GIF and PNG accept odd sizes.

## No transparency in the output

A render has an alpha channel only when the composition has **no `background`** and the format supports alpha:
`.webm` (VP9), `.mov` (ProRes 4444), a PNG sequence, or `.gif` (1-bit). Check:

- `.mp4` never has alpha; transparent areas are black. Render `.webm` or `.mov`.
- Remove `background` from the composition, and any full-frame `rect` used as a background.
- Some players show WebM alpha on black. Check in a browser or an editor, or look at a `vidmake still` PNG, which
  keeps transparency too.
- GIF edges look jagged: GIF transparency is on/off per pixel. Use WebM for soft edges.

Details: [rendering → transparency](https://vidmake.app/docs/rendering.md#transparency).

## Audio missing

Work through these in order; `vidmake timeline project.json` lists every clip that will be mixed under `Audio:`.

1. **The output format has no audio:** `.gif` and PNG sequences never do.
2. **`--muted`** was passed to `render`.
3. **The video layer is `muted: true`**, or its source has no audio stream (`vidmake probe clip.mp4` shows
   `"hasAudio": false`).
4. **The clip isn't in the rendered range:** a `start` past the end (`validate` warns `[afterEnd]`), a `--frames`
   range that excludes it, or a `trimStart` beyond the source length.
5. **Volume is 0**, or a `volume` keyframe list starts at 0 and never rises; fades longer than the clip.
6. **The player is muted.** Browsers autoplay muted; the demo players on this site start muted too.

A project with no sound at all renders an MP4 without an audio stream, which some upload tools reject. Add a
silent or quiet `audio` layer if you need a track.

## Slow renders

- Preview first: `vidmake storyboard` and `vidmake still` are instant compared to a render; `render --draft`
  renders at half size, without motion blur, with the fastest encoder settings.
- Render only what you are checking: `--frames 4s-6s`.
- Composition `motionBlur` multiplies the cost by its `samples`. Large `blur`, `glow` and `shadow` radii on big
  layers are the most expensive effects.
- Many simultaneous video layers each need their own ffmpeg decoder.
- On memory-constrained machines, lower `--concurrency`.

More in [rendering → performance](https://vidmake.app/docs/rendering.md#performance).

## Validate errors

Errors name the composition, the layer id and its position (`main > layers[0]`, or ``group `intro` > layers[2]``
inside groups), and the field. The common ones:

| message | meaning and fix |
|---|---|
| ``composition `main`: unknown field `fontsize` — did you mean `fontSize`?`` | a misspelled field anywhere in the composition. Fields are camelCase and checked strictly. Without a close match, the message lists the valid fields |
| ``field(s) fontSize do not apply to `rect` layers`` | the field exists but not on this layer type. Check the type's page under [layers](https://vidmake.app/docs/layers.md) |
| ``unknown layer type `rectangle`. Available: rect, ellipse, text, ...`` | use one of the listed `type` values |
| ``text layer needs `text` `` / ``image layer needs `src` `` / ``path layer needs `d` (SVG path data)`` | a required field for that type is missing |
| `file not found: ./broll.mp4 (paths are relative to the project file)` | `src` and font paths resolve from the project file's folder, not your shell's. URLs are not supported |
| ``font family `X` not found ...`` | see [fonts missing](https://vidmake.app/docs/troubleshooting.md#fonts-missing) |
| ``could not infer a duration (no layer has a fixed length). Set `duration`, e.g. "duration": "5s"`` | with `duration` omitted or `"auto"`, at least one layer needs a fixed length (media, explicit `duration`, or a series) |
| ``layer `a` is inside a series group and needs a `duration` `` | every child of a `series` group needs a fixed length |
| ``composition `main` duration: invalid time `3 sec` (use frames, "2.5s", "500ms", "90f" or "m:ss")`` | see [time values](https://vidmake.app/docs/time.md) |
| ``unknown function `sinn` in expression ... Available: sin cos tan ...`` | a typo in an `=expression` or `${...}`; the list shows every function |
| ``unknown variable `foo` in expression `foo * 2`. Available: t f gt gf fps dur durf p w h pw ph i n amp bass beat beats pi e tau`` | expressions only know these variables; props are spliced in with `{{name}}` and theme tokens with `$name`, not as variables |
| ``unexpected token End in expression `w/2 +` `` | an incomplete expression |
| ``tween needs `end` or `duration` (or `spring`)`` | a `{from, to}` object without a length; often a misspelled `duration` |
| ``keyframe must be [time, value, ease?] or {t, v, ease}, got ["1s"]`` | a malformed keyframe |
| ``unknown easing `easeOutBounc`. Available: ...`` / ``unknown preset `fadeUpp`. Available: ...`` | see [easing](https://vidmake.app/docs/easing.md) and [presets](https://vidmake.app/docs/presets.md) |
| ``invalid color `#ggg` (use #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), oklch(), oklab() or a CSS name)`` | see [colors](https://vidmake.app/docs/colors.md) |
| ``unknown theme token `$color.acent` — did you mean `$color.accent`?`` / ``$accent is ambiguous: $color.accent, $chart.accent`` | a misspelled token, or a short name two groups share: write the full path. `vidmake theme` lists every token; see [theme](https://vidmake.app/docs/theme.md#references) |
| ``theme alias cycle: a → b → a`` | two tokens alias each other; see [aliases](https://vidmake.app/docs/theme.md#aliases) |
| ``unknown motion `snapy`. Motions: smooth, snap, bouncy, gentle ...`` | a misspelled `motion`; theme motions are listed too. See [motion](https://vidmake.app/docs/easing.md#motion) |
| ``motion `"curve"` has no duration of its own; add `duration` `` | a tween with a bare easing as its `motion`; add `duration` or give the motion one |
| `` `to` belongs to exit; enter takes `from` `` | `enter` starts *from* a state and `exit` ends *to* one; see [states](https://vidmake.app/docs/presets.md#states) |
| `` `rise` is for text layers ...`` / ``wipes don't apply per unit ...`` | `rise` and `clip: "line"` need a text layer; a staggered text can't wipe per letter. See [presets](https://vidmake.app/docs/presets.md#rise) |
| ``attach target `nope` must be a sibling layer (same parent)`` | `attach` only reaches layers in the same parent; see [attach](https://vidmake.app/docs/attach.md) |
| ``no composition `lowerThird`. Available: main`` | a `use` layer's `ref` or a `--comp` value doesn't match a composition `id` |
| ``unknown lint code `offscreen` (all, offCanvas, ...)`` | see [lint](https://vidmake.app/docs/lint.md) |
| `error: project.json: invalid JSON: trailing comma at line 1 column 88` | the file isn't valid JSON (trailing commas and comments aren't allowed). This one exits with status 1 and no `✗` line |

When the error is in a nested layer, the message chains the path:
``layer `inset` (pip > layers[1]): layer `cam` (group `inset` > layers[1]): ...``.

> [!TIP]
> Point your editor at the [JSON Schema](https://vidmake.app/docs/schema.md) to catch unknown fields and wrong types while typing.

## Warnings after upgrading from 0.5

A 0.5 project still renders, with warnings like these:

```output
✓ tokens — 90 frames (3.00s)
  warning: `tokens` is now `theme`: rename the field, and write `$color.accent` instead of `{{color.accent}}`
  warning: composition `tokens`: `{{color.ground}}` reads the theme; write `$color.ground` (`{{}}` is for props)
```

`vidmake migrate project.json` fixes all of them (`--check` to see what it would change first). Entrances and
text staggers also look different after the upgrade: they now default to the `smooth` spring and shorter moves
(0.3em on text). That's intended; see [presets](https://vidmake.app/docs/presets.md#motion) and [stagger](https://vidmake.app/docs/text.md#why-a-budget) to tune
them, or pin the old
feel on one layer: `"enter": { "type": "fadeUp", "distance": 40, "motion": { "ease": "easeOutCubic", "duration": "0.5s" } }`.

## Lint warnings

Warnings ending in `[offCanvas]`, `[textOverflow]`, `[invisible]`, `[zeroDuration]` or `[afterEnd]` don't stop
rendering, but each one is worth a look. The [lint page](https://vidmake.app/docs/lint.md) explains what triggers each, how the check
frame is chosen, and how to silence intended ones with `"lint": { "ignore": [...] }`.

A common surprise: a warning names a frame where the layer looks fine in your storyboard. The check uses one frame
(the midpoint, or after the enter preset); inspect that exact frame with `vidmake inspect project.json -f <frame> -l <id>`.

## Something renders in the wrong place or not at all

- **Nothing visible:** check `vidmake timeline` (is it on screen then?), the layer order (last is on top; a full
  `rect` added later covers everything), and `vidmake inspect -t <time> -l <id>` for `OPAC` 0 or a bbox off the
  canvas.
- **Animation never plays:** animation times are local to the layer's `start`. A tween with `"start": "3s"` on a
  layer that starts at 3 s begins at 6 s. Numbers are frames: `"duration": 2` is two frames, not two seconds.
- **Group children misplaced:** inside a group, `x`/`y` are relative to the group's box (0,0 = top-left), and the box
  defaults to the parent size.
- **Mask in the wrong place or time:** a `mask` is positioned and timed like a sibling of the masked layer, so it
  needs the same `x`/`y`/`start` (see the [logo reveal recipe](https://vidmake.app/docs/recipes.md#logo-reveal-with-a-mask)).
- **Video frame blank in stills:** ffmpeg couldn't start (see above). A video layer that has ended isn't drawn
  at all: video layers default to their media length, so set `loop: true` or a `duration` to keep them on screen.

## License

- **`error: vidmake needs a license to run`, exit status 3:** this Mac has no activation. Open the vidmake app
  and buy or enter your key, run `vidmake license activate <KEY>`, or set `VIDMAKE_LICENSE_KEY`. Lost the key? The
  app's paywall and the [license page](https://vidmake.app/license/) email it to you.
- **`this license is active on 3 machines already`:** deactivate vidmake on a Mac you no longer use (**License**,
  then **Deactivate this Mac**, or `vidmake license deactivate`). The error lists the Macs and when each was last
  used; one unused for 30 days frees its seat by itself.
- **`vidmake checks its license with the server at least once every 30 days`** (the app: *Connect to the
  internet*): the Mac has been offline for longer than its activation lasts. Connect once and try again.
- **`your license covers vidmake 1.x, and this is vidmake 2`** (the app: *vidmake 2 is here*): this app is a newer
  major version than your license. Upgrade from the app, or keep using vidmake 1: the app's
  **Download vidmake 1.x instead** gets the newest release your license covers.
- **The app stays on *Finish in your browser*:** it's waiting for Stripe to confirm the payment, which is usually
  seconds. If you closed the checkout, choose **Reopen checkout** or **Cancel**. If you paid and it still waits, the
  key is in your email: choose **Cancel**, then **I have a license key**.

## The update check

Once a day vidmake asks the license server for a newer release (3-second timeout). On a terminal it asks
whether to update; otherwise it prints one line to stderr:

```output
note: vidmake 1.2.1 is available (you have 1.2.0); run `vidmake update` to install it
```

- **Disable it** with `VIDMAKE_NO_UPDATE_CHECK=1` (also skipped when `CI` is set). Recommended for agents, CI and
  scripts. Stdout and `--json` output are never affected either way.
- **A delay of up to 3 seconds** on the first command of the day means the license server is slow to reach.
  Disable the check if that matters.
- **An update can't write to the app's folder:** updating replaces `vidmake.app` where it is, so it needs write
  access to that folder (Applications is writable by administrators). Update as an administrator, or download the
  new version and drag it to Applications.
- **`vidmake isn't running from vidmake.app, so it can't update itself`:** this `vidmake` was copied out of the
  app. Run the one inside it (link it as [installation](https://vidmake.app/docs/installation.md#the-vidmake-command) shows).
- **Skipped a version by mistake:** the choice is stored in `update-check.json` in the cache folder
  (`$VIDMAKE_CACHE_DIR`, else `$XDG_CACHE_HOME/vidmake` or `~/.cache/vidmake`). Delete the file to reset it.

See [CLI → the update check](https://vidmake.app/docs/cli.md#the-update-check).

## Still stuck?

- `vidmake docs <topic>` prints the relevant part of the [reference](https://vidmake.app/docs/reference.md).
- Set `VIDMAKE_DEBUG=1` to see the exact ffmpeg command of a render, and try it by hand.
- Reduce the project: delete layers (`vidmake rm`) until the problem disappears, then look at the last one removed.
