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.
vawe turns one HTML pageA page is one HTML file, films/<name>/page.html, that describes a whole film. into one filmA film is the mp4 file that the renderer makes from one page.. You write the page in HTML, CSS, Web Animations, SVG, canvas or three.js. The renderer seeksTo seek is to set the page to a time t in seconds and paint the frame for that time. 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 page contractThe page contract is the set of rules that a page obeys so that the renderer, the checks and the judge can read it. 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 determinismDeterminism means that the same page gives the same frames on every render, in any order., 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 loopThe loop is the ten stages that make a film: brief, references, design kit, states, board, draft, motion pass, critique, fix and final.. Read Use with Claude Code, Codex or Cursor. - People who write HTML. You write or edit the page yourself, and you watch the draftA draft is a fast render at half size and 30 fps, with sound, made by vawe dev..
You need no hosted API and no account.
How it works
- The renderer opens the page in Chrome. Before any script of the page runs, it installs a virtual clockThe virtual clock is the code in core/engine/page-clock.js that controls Date, requestAnimationFrame, timers and Math.random during a render. that owns
Date, timers,requestAnimationFrameandMath.random. - It sets the aspectThe aspect is the width-to-height ratio of a film, such as 16:9, 9:16 or 1:1. variables
--vwand--vhand the attributedata-aspect. One page then lays out for16:9,9:16,1:1,4:5and4:3. - For each frame it seeks the page to
t: CSS animations andelement.animate()get theircurrentTime, andwindow.seek(t)paints the frame. - It encodes the frames with ffmpeg, mixes the
<audio>tags offline and writes one mp4 toout/.
The owner of this work is harness/media/render-page.mjs. Read 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:
<!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 cueA cue is one sound at one second, written as an <audio> tag with data-at.: a built-in voiceA voice is one of the built-in synth sounds, such as pluck or whoosh, chosen with data-synth="<voice>". at 0.4 s.
Limits
- vawe renders one page to one film. You learn no timeline API.
- A frame must come from
talone. 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
Quickstart
Use with an agent
The page
For every verbA verb is one command of the vawe CLI, such as new, dev or ship, run as bin/vawe <verb>. and flag, read CLI. For the words on these pages, read the Glossary.
From the blogHTML to video format: the page contract · Freeze Date.now and seed Math.random to render video frames