← Back to blog
AiAbout 6 min read

Films written as code, rendered frame by frame in a headless browser

Published Nov 29, 2026
Films written as code, rendered frame by frame in a headless browser

The first thirty seconds of the demo reel on the cinecode repository show a stone arch at sunrise, a postage train printed like a linocut in snow, a carved clockwork mechanism, a 3D rabbit in a desert, a miniature city under falling code, a pop-art whale underwater, a camera on rails in a wheat field, and a jazz poster. Every frame was produced by code in a headless browser.

That sentence is the whole idea. There is no text-to-video model in the loop. The skill teaches a coding agent to write a scene as a function of time, then photograph it.

What the agent actually writes

The output is one self-contained film.html. The scenes inside it are expressed as a function of time: given t, draw this frame. That can be Canvas 2D, or three.js and WebGL, plus a text layer for on-screen type.

Because the film is a program, every property that usually gets decided by chance is a value someone chose. Camera moves are not adjectives in a prompt; they come from a named vocabulary in references/camera-moves.md: dolly in, orbit, dolly zoom, FPV, shoulder camera, speed ramp, focus pull, match cut, whip pan, J-cut. Each entry carries what the move makes an audience feel, plus a default duration, speed and easing.

A shot is then one line, in the README's example: "dolly in, 3 s, slow ease-in-out, toward the figure". Both render paths apply it as a pure function of time.

The look is chosen before the film is built, from a board assembled out of frames from real films. Eight view presets ship with the three.js starter. You approve the first two scenes before anything longer is rendered, which is the cheapest possible place to discover that the tone is wrong.

The parts that are not the renderer

The interesting engineering here is in the guards, not the pixels.

The kit installs as a skill, by asking the agent to install it from the repository, which clones into ~/.claude/skills/cinecode (or the Cursor equivalent). It ships make.py and qc.py plus a set of hooks that stop specific failures in Claude Code: asking for a scenario without showing it, moving to a draft without showing it, stopping right after approval. Those hooks only work in Claude Code with a recent version that supports exec-style hooks; in other agents the film still renders, the guard reports itself off.

That is a real distinction. A skill can carry instructions and scripts to any agent. Enforcement is a host feature, and pretending otherwise would be worse than saying it plainly.

Requirements are ordinary: Node.js 22 or newer, Python 3.9 or newer, ffmpeg, and Chrome or Chromium or Edge. A GPU Chrome can use is helpful; without one, the render falls back to CPU, which is fine for a test and slow for a whole film. The agent probes this up front via capture.mjs --probe and asks before installing anything.

Nothing else is installed. Scripts use only built-in modules, and three.js loads pinned library versions from a CDN.

One HTML scene, a frame clock, and an ffmpeg mux

Ten-minute videos get acts

Short films are the demo. The longer mode is the more ambitious claim: documentaries, explainers and video essays over ten minutes, built in acts and chapters.

The README describes what that changes. The script has to be researched, and every claim about a real person or event has to be written with its source. The first minute has to establish a clear question, with a curiosity map holding the viewer to the end. Narration is in your language, either a Turkish or English voice, optionally through your own Gemini key or ElevenLabs, or a free Turkish voice.

Visual material comes from open archives: photographs, maps, documents, footage. Where there is no archive, there is code, including maps that draw themselves.

That last part is where a code-based film stops being a gimmick. An archive documentary is mostly a research problem with a rendering problem attached. If the rendering is deterministic, you can fix a scene without re-rolling a model and hoping the rest of the frame survives.

Sound is scripted too

The audio gets the same treatment as the picture, which is rare in this category. Each film carries a light sound identity, layered ambience under the scenes, tested ffmpeg recipes for the mix, and mastering to −14 LUFS.

That last number is the same target the serious video tooling has converged on, and for the same reason: platforms normalise toward it, so a film mastered elsewhere arrives quieter or squashed. A model that generates audio from a prompt has no idea what −14 LUFS means. A build step does.

Offline behaviour is spelled out as well. Rendering, mixing and the checks run offline. The fast-mode starter file is Canvas 2D plus Web Audio, so it needs nothing. Searches need a network for references, music and the first font and look downloads, after which they stay cached. The three.js starter needs the network once for its libraries, or a local copy.

Tests run with python3 -m unittest discover -s tests, with an environment flag to include real Chrome and ffmpeg. The suite runs on every push on Windows and Ubuntu, and macOS on changes. The README also says a full film has not yet been tried end to end on Windows, which is the kind of caveat that makes the rest of the document easier to trust.

What it costs, and what it cannot do

There is no paid service in the loop. The README says so explicitly, and the dependencies are MIT and Zlib licensed libraries loaded at render time rather than bundled.

The cost is time and tokens. A ten-minute film at 30 fps is 18,000 frames, each one drawn in a browser and captured. The demo reel is a highlight cut; the repository is honest that a full film has not been tried end to end on Windows yet, even though the tests run there.

And taste is still a person's job. The camera vocabulary gives an agent a shared language for moves, but choosing a whip pan over a slow push is a decision about meaning. The kit can enforce that a scenario was shown before it was used. It cannot tell whether the scenario is any good.

Why this approach is worth watching

Text-to-video models are getting better at surfaces and remain unreliable at structure. Ask for nine shots that add up to a story, and you get nine shots that look like the same film and do not connect.

Writing the film as code inverts the difficulty. Structure becomes explicit, because it is a sequence in a file. Continuity is free, because the same object can be reused across scenes instead of regenerated. Revision is cheap, because changing a camera move is changing one line, and the output is the same on every machine.

What you give up is the accidental beauty of a diffusion model: the texture it invents, the lighting nobody specified. cinecode's answer is craft. Real lighting in 3D, paint, ink, paper, clay, motion graphics, pixel art, each chosen deliberately, with reference frames from real films as the target.

It is a slower way to make a moving image. It is also the first approach in a while where the tenth revision costs less than the first, which is how every other kind of software behaves and how video generation so far has not.

Turn ideas into images with ChatPicture

60 free credits every day. Generate, edit, and download — no prompt engineering degree required.

Related articles