html-video — Turn HTML Into Programmatic MP4 Videos With Your AI Coding Agent
html-video — Turn HTML Into Programmatic MP4 Videos With Your AI Coding Agent 🎬
What is it? html-video is an open-source (Apache 2.0) meta-layer for programmatic video generation built by the nexu-io team (creators of Open Design and HTML Anything). It sits above existing rendering engines (Hyperframes, Remotion, Motion Canvas) and lets your local AI coding agent turn HTML, CSS, and data into real MP4 videos — all on your machine, with no per-render fees or vendor lock-in.
Why it's trending: html-video hit 1,845+ GitHub stars in under two weeks because it solves a real pain point for coding agents. Before html-video, generating a video meant either learning a complex DSL (Remotion, Manim), relying on cloud rendering APIs with per-minute billing, or stitching together screenshots manually. html-video wraps all of that into a single agent-friendly interface: your coding agent writes animated HTML frames, and html-video handles the recording (headless Chromium) and encoding (ffmpeg libx264). It works with 14 coding agents — Claude Code, Codex CLI, Cursor Agent, Gemini CLI, Hermes, Windsurf CLI, Copilot CLI, and more — all auto-detected on your PATH. The Open Design ecosystem (HTML Anything, Open Design itself, now html-video) is building a complete open-source stack for agent-driven content creation, and html-video is the motion component that was missing.
📋 Prerequisites
Before we start, make sure you have:
- Node.js 20+ and pnpm 9+ installed (
npm install -g pnpm) - ffmpeg installed (
ffmpeg -version) - Chromium (via Playwright:
npx playwright install chromium) - Git for cloning the repo
- At least one AI coding agent CLI installed (optional but recommended for the full workflow)
🔧 Setup & Installation
Clone the repo and install dependencies:
git clone https://github.com/nexu-io/html-video.git
cd html-video
pnpm install
pnpm -r build
That's it — no API keys, no cloud accounts, no Docker. Everything runs locally.
Verify Your Setup
Run the doctor command to check that all prerequisites are met:
node packages/cli/dist/bin.js doctor
This detects installed agents, engines, Chromium availability, and ffmpeg. You'll see output like:
✓ Node.js 22.22.3
✓ pnpm 9.x
✓ ffmpeg detected
✓ Chromium available (via playwright)
✗ No coding agents found on PATH
Launch the Studio
node packages/cli/dist/bin.js studio
This starts a local browser studio at http://127.0.0.1:3071 with:
- A live template gallery (21 templates)
- An agent selector (auto-detected CLIs)
- A per-frame text editor for storyboarding
- AI soundtrack panel (optional MiniMax API key)
- Export to MP4 button
🎬 How It Works
The pipeline is simple: one prompt (or link) goes in, a real MP4 comes out.
⚙️ Architecture Overview
html-video is built around a pluggable engine architecture with six main components:
-
Source Fetcher — takes a prompt, a URL (article link), or a GitHub repo URL, fetches the content server-side, and flattens it to Markdown. Server-rendered pages (like WeChat 公众号 articles) work out of the box.
-
Agent Runtime — auto-detects which coding agents are on your
PATH(14 supported: Open Design Vela, Windsurf CLI, Trae CLI, Claude Code, Cursor Agent, Codex CLI, Hermes, Gemini CLI, Grok Build, Qwen Code, OpenCode, GitHub Copilot CLI, Aider, Anthropic Messages API). The agent reads the source material and decides the storyboard. -
Content Graph — a multi-frame intermediate representation (IR) built by the agent. Nodes represent entities, data points, or text. Edges represent sequence, dependency, or contrast. The graph is topologically sorted into frame order with timing.
-
Frame Renderer — each node in the content graph becomes a self-contained animated HTML file on disk. Templates from the 21-template gallery provide visual styles (data charts, title cards, product promos, explainers, cinematic frames).
-
Hyperframes Engine — the shipped rendering adapter. It launches headless Chromium (via Playwright), loads each HTML frame, records the animation frame-by-frame (auto-extending to cover CSS/JS animations), and outputs webm files.
-
FFmpeg Encoder — takes the per-frame webm files, encodes them to MP4 (libx264), concatenates into a single video, and optionally mixes in AI-generated soundtrack (MiniMax music + narration).
Single-frame videos take a fast path that skips the content graph entirely.
Supported Workflows
| Workflow | Input | Output |
|---|---|---|
| Prompt → Video | Describe a topic | Agent writes scenes from scratch |
| Article → Video | Paste a URL | Content fetched, analyzed, storyboarded |
| Repo → Video | GitHub repo URL | README + structure turned into walkthrough |
📦 21 Templates at a Glance
html-video ships with 21 curated, license-clean templates (all Apache-2.0 compatible):
- Data Viz — NYT-style animated line charts, Swiss/Vignelli grid data cards
- Title Cards — Glitch titles with chromatic aberration, kinetic type, typewriter cursor VFX
- Heroes & Cinematics — Liquid gradient heroes, light-leak film grain, warm-grain editorial
- Product Promos — 15s / 30s multi-scene product reveal storyboards
- Explainer Scaffolds — Decision-tree explainers, multi-step tutorials
Every template is described by a template.html-video.yaml manifest that the agent reads to understand what the template does, what inputs it needs, and what resolution/fps/duration it supports — without ever opening the HTML file.
🎵 AI Soundtrack
html-video supports optional AI-generated audio:
- Background Music — describe a mood (
"calm cinematic ambient, slow build"), MiniMax generates an instrumental track - Narration — type a script; MiniMax TTS reads it
Both are mixed into the exported MP4 via ffmpeg (music ducked under voice, fade in/out). No MiniMax key configured? The rest of the studio works unchanged.
🚀 CLI Quick Reference
Besides the studio, html-video comes with useful CLI utilities:
# Check your setup
node packages/cli/dist/bin.js doctor
# Search templates by intent
node packages/cli/dist/bin.js search-templates --intent "github stars race" --top 3
# Launch the studio
node packages/cli/dist/bin.js studio
🧪 Verification Checklist
pnpm install && pnpm -r buildcompletes without errorsnode packages/cli/dist/bin.js doctorreports all green- Studio launches on
http://127.0.0.1:3071 - Template gallery loads all 21 templates
- Agent selector detects your installed CLI(s)
- Single-frame video renders to MP4 successfully
🔗 Resources
- GitHub: github.com/nexu-io/html-video
- Website: open-design.ai/html-video
- Docs: In-repo README and the
research/directory with RFCs - Sister project: HTML Anything — static HTML deliverables from agents
- Sister project: Open Design — design-agent meta-layer
- Engine: Hyperframes — HTML+CSS+GSAP rendering paradigm
- License: Apache 2.0