# Introduction

> How to turn one HTML page into an MP4 with vawe, for you or an AI agent. Install, the page contract, motion, sound and rendering.

Canonical: https://vawe.dev/docs

vawe turns one HTML <Term id="page">page</Term> into one <Term id="film">film</Term>. You write the page in HTML, CSS, Web Animations, SVG, canvas or three.js. The renderer <Term id="seek">seeks</Term> the page to each time, takes a picture, mixes the audio and writes an mp4.

## Why it exists

A film editor needs a timeline and a private format. An agent does not know either one. An agent does know HTML and CSS, so vawe uses them.

vawe has one promise: if something you would naturally write in a page fails, that is a framework bug. You learn the few rules of the <Term id="page-contract">page contract</Term> and nothing else.

Time is the seek, never the clock. Every frame is a function of the time `t`. The same page gives the same frames on every render. This is <Term id="determinism">determinism</Term>, and it lets the renderer capture frames in parallel and render again only the seconds you change.

## Who it is for

* **Agents.** An agent reads `AGENTS.md`, loads the skills and follows the <Term id="loop">loop</Term>. Read [Use with Claude Code, Codex or Cursor](https://vawe.dev/docs/agents).
* **People who write HTML.** You write or edit the page yourself, and you watch the <Term id="draft">draft</Term>.

You need no hosted API and no account.

## How it works

<PageToFilm caption="The renderer does this for every t from 0 to the duration, then mixes the audio." />

1. The renderer opens the page in Chrome. Before any script of the page runs, it installs a <Term id="virtual-clock">virtual clock</Term> that owns `Date`, timers, `requestAnimationFrame` and `Math.random`.
2. It sets the <Term id="aspect">aspect</Term> variables `--vw` and `--vh` and the attribute `data-aspect`. One page then lays out for `16:9`, `9:16`, `1:1`, `4:5` and `4:3`.
3. For each frame it seeks the page to `t`: CSS animations and `element.animate()` get their `currentTime`, and `window.seek(t)` paints the frame.
4. It encodes the frames with ffmpeg, mixes the `<audio>` tags offline and writes one mp4 to `out/`.

The owner of this work is `harness/media/render-page.mjs`. Read [The page](https://vawe.dev/docs/the-page) for the full contract.

## What you make

A film is the folder `films/<name>/`: the file `page.html` and its own `assets/` folder. This is a whole film of six seconds:

```html
<!doctype html>
<meta name="duration" content="6">
<meta name="message" content="one page, one film">
<style>
  body { margin: 0; background: #0b0d12; color: #f4f6fb; font: 700 calc(var(--vh) * 0.08) system-ui; }
  h1 { position: absolute; left: 8%; top: 40%; animation: rise 0.6s var(--ease-land) both 0.4s; }
  @keyframes rise { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
</style>
<h1>one page, one film</h1>
<audio data-synth="chime" data-at="0.4" data-gain="-6"></audio>
```

`<meta name="duration">` sets the length in seconds. The `<audio>` tag is a <Term id="cue">cue</Term>: a built-in <Term id="voice">voice</Term> at 0.4 s.

<Video src="loop/draft.mp4" poster="loop/draft.webp" caption="A draft of the example film colour-sting: half size, 30 fps. Made with vawe dev." />

## Limits

* vawe renders one page to one film. You learn no timeline API.
* A frame must come from `t` alone. A page that reads the wall clock or keeps state between frames breaks the contract.
* Output can differ between hosts that rasterise on a different GPU or Chrome version.

## Where to go next

- []()" title="Quickstart" href="/docs/quickstart">
    Install vawe and render a first draft.
  </Card>

- []()" title="Use with an agent" href="/docs/agents">
    Claude Code, Codex or Cursor, the skills and the run log.
  </Card>

- []()" title="The page" href="/docs/the-page">
    The page contract: duration, seek, aspect, audio.
  </Card>

For every <Term id="verb">verb</Term> and flag, read [CLI](https://vawe.dev/docs/cli). For the words on these pages, read the [Glossary](https://vawe.dev/docs/glossary).

{/* sources (vawe d8481cc61):
  what vawe is, seek, virtual clock, aspects, audio: README.md "vawe: HTML to video for coding agents" and "A film is one HTML page"
  promise "a framework bug": AGENTS.md first paragraph
  example page: README.md "A film is one HTML page"
  no hosted API, no account: skills/html-to-video/SKILL.md
  host differences: README.md "Install"
  renderer owner: README.md "Architecture" (harness/media/render-page.mjs)
  renders frames in parallel: README.md "Determinism"
  */}
