← BACK TO HOME
CASE STUDYSOURCE ONLY

montaj

AIROLE — SOLE BUILDER

A CLI and agent skill that turns a small YAML spec into a finished video. A coding agent writes the spec; montaj renders, checks and mixes it on the GPU, and answers every command with one line the agent can act on.

PYTHONPYTORCHCUDANVENC
montaj — rendered output
montaj — live preview

PROOF

MEASURED, SOURCED
646 → 225 s
FINAL RENDER OF A 165 S FILM
Repository BENCHMARK.md and STATE.md
2.7M → 0.3M
AGENT TOKENS PER FILM
BENCHMARK.md — before montaj vs composed-music runs
340
COMMITS
git rev-list --count main, 1 Oct – 11 Nov 2026
OPEN REPOSITORY EVIDENCE (1)
1,115
TEST FUNCTIONS
grep of def test_ under tests/

THE PROBLEM

WHAT NEEDED SOLVING

Agents can write code but are clumsy video editors: driving a timeline tool burns millions of tokens and the result drifts off the beat. Video needed an interface an agent is good at, plain text in and a checked file out.

THE APPROACH

HOW IT WAS BUILT

The agent writes one montaj.yaml: shots, text, music, looks and transitions. montaj resolves it into a frame-by-frame timeline, renders each segment on the GPU with NVDEC and NVENC, rasterises text once per card in headless Chromium, mixes audio with two-pass loudness normalisation, and runs QA for black frames, frozen spans, loudness and A/V sync. Segments are cached by hash, so an edit re-renders only what changed. Every command prints OK, WARN or ERR with the fix.

FIELD NOTES

PROBLEMS HIT — AND RESOLVED
  1. 01

    RE-RENDER ONLY WHAT CHANGED

    The renderer may read only the frame plan, the shots and the asset files, so each segment's hash is a complete cache key. On a real film, one edit re-rendered 2 of 13 segments.

  2. 02

    ONE 8 GB GPU, MANY JOBS

    Rendering and music generation share a file lock so they queue instead of running out of memory; a strict mode turns any silent CPU fallback into an error. Peak VRAM on a 165 s film fell from 4.17 to 3.61 GB.

  3. 03

    CUTS ON THE BEAT

    Beat units snap to the detected grid of the track. End-to-end, 12 cuts landed within 1 ms of the detected beats.

  4. 04

    FRAME-EXACT GPU DECODE

    The NVDEC path reproduces ffmpeg's seek, rounding, chroma siting and colour matrix, so a 165 s film decodes framemd5-identical on either path.

CAPABILITIES

WHAT IT ACTUALLY DOES
  • One YAML spec in, a finished H.264 MP4 out, with export presets
  • Segment-hash render cache: edits re-render only the shots they touch
  • Captions chunked by a dynamic programme within reading-rate and safe-zone limits
  • QA for black or frozen frames, loudness, A/V offset and colour tags
  • Local review server for comments, and a watch mode that re-renders on save