HTML to Video:
Four Ways to Turn a Web Page Into an MP4
Updated · 8 min read
There are two ways to get a video out of a web page. A renderer can ask the page for one frame at a time and encode the stills, or a recorder can watch the page play and save what it saw. This guide compares four tools across those two methods, from each tool's own documentation read the day this guide is dated, and from what we found building video skills on all four.
What are the ways to convert HTML to video?
Seek the page frame by frame, or record it in real time. Seeking gives the same file on every run, however slow the machine, because the page draws each frame from its time alone and nothing reads the clock. Recording keeps whatever really happens, including live playback and network data, but a busy machine drops frames and every take differs.
- HyperFrames, from HeyGen: you write a plain HTML page with timed clips, and its CLI seeks it and encodes the frames.
- Remotion: you write React components that read the current frame number, and its renderer captures each frame.
- A headless browser plus FFmpeg: you script Puppeteer or Playwright to screenshot each frame or record the page, and FFmpeg encodes the result.
- Screen recording: OBS Studio or the browser's own screen capture records the page as it plays.
The first three run Chrome without a window. The difference is who controls time: the framework, your script, or nobody.
How does HyperFrames turn HTML into video?
It seeks a paused animation timeline to each frame in headless Chrome and encodes the frames with FFmpeg. Each element carries data-start and data-duration, and the motion comes from a seekable runtime: GSAP, CSS, Lottie, Three.js, Anime.js, the Web Animations API or an adapter you write. HeyGen's determinism page sets out the loop: the engine computes each frame's time with integer math, never a clock, then Chrome grabs the pixels and FFmpeg encodes them and mixes in the sound from the page's audio and video elements.
npx hyperframes init my-video
npx hyperframes preview
npx hyperframes render --output final.mp4There is no build step; an index.html plays as it is. It is Apache 2.0 and needs Node.js 22 or later and FFmpeg. The price of determinism is a short list of rules: no Date.now(), no unseeded Math.random(), no fetching mid-render. Its capture command pulls a public website into a folder an agent can build from, which is the closest it comes to converting a URL.
AdAnt's UI Card Promo skill renders with HyperFrames, and the free HyperFrames: HTML to Video download is HeyGen's official skill at a pinned commit. The steps, checks and common errors are in the HyperFrames tutorial.
How does Remotion render React to video?
A React component gets the current frame number and returns what that frame looks like; Remotion captures the frames in Chrome Headless Shell. Its docs describe the idea as a frame number and a blank canvas you fill with React. A video has a width, a height, a durationInFrames and an fps, and sound comes from its Video and Audio components in @remotion/media.
npx create-video@latest --yes --blank my-video
cd my-video
npx remotion renderThe blank template renders an empty video until you add content; for a first project without a coding agent, Remotion recommends --hello-world instead. Remotion opens several browser tabs to render in parallel, and its docs warn that tabs share no state, so an animation that runs off anything but useCurrentFrame() breaks. Write every frame as a function of the frame number and it renders the same each time. It downloads Chrome Headless Shell into node_modules the first time it needs a browser.
The license is the deciding difference. Remotion is free for individuals and companies of up to 3 people. Other companies need a Company License: Creators at $25 a month per seat, or Automators at $0.01 per render with a $100 monthly minimum. For the setup with Claude Code, see Remotion with AI; for the two frameworks side by side, Remotion vs HyperFrames.
How do you render a page frame by frame with Playwright and FFmpeg?
Pause every animation, set the page's time yourself, screenshot each frame, then join the stills with FFmpeg. Puppeteer and Playwright are browser automation libraries, both Apache 2.0, not video frameworks, so the timing is yours. This Playwright script, which we ran against a page with a CSS animation, seeks the page to each frame's time and saves numbered PNGs. Run it with the page's address, such as node capture.mjs file:///path/to/page.html:
import { chromium } from "playwright";
const fps = 30;
const frames = fps * 4;
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto(process.argv[2]);
for (let i = 0; i < frames; i++) {
await page.evaluate((t) => {
for (const a of document.getAnimations()) {
a.pause();
a.currentTime = t * 1000;
}
window.renderAt?.(t);
}, i / fps);
await page.screenshot({ path: `frame-${String(i).padStart(4, "0")}.png` });
}
await browser.close();document.getAnimations() returns the page's CSS animations, CSS transitions and Web Animations, and an animation's currentTime sets its time in milliseconds. Anything drawn by script needs a function that draws any moment on demand, here renderAt(t). Then encode:
ffmpeg -framerate 30 -i 'frame-%04d.png' -pix_fmt yuv420p out.mp4Keep -pix_fmt yuv420p. Without it, FFmpeg encodes PNG input as yuv444p, and most browsers other than Chrome only play yuv420p.
That output is only deterministic if nothing on the page runs off the wall clock. Playwright's clock API can take over Date, setTimeout, setInterval, requestAnimationFrame and performance so you can pause and step them, but CSS animations are not on its list. timecut packages the same idea for pages you did not write: it overwrites a page's time functions with a virtual clock, though its README warns that CSS transitions and animations will likely not render as intended.
AdAnt's Narrated Explainer skill uses this route with Playwright: frame n is drawn at n / fps seconds and piped to FFmpeg. Its example, a 19.2-second explainer at 1280x720, rendered in about 20 seconds on an Apple laptop.
How do Puppeteer and Playwright record a page in real time?
Both can save a video of the page as it plays, with no control over time. It is the quickest capture of a test run or a demo, and like any recorder it drops frames on a busy machine.
Playwright saves a video of each page when you create its browser context with recordVideo. It is written when the context closes, defaults to the viewport scaled to fit 800x800 at 25 fps, and its options cover size, frame rate and action annotations, not sound.
Puppeteer's page.record() records an MP4 through Chrome's Page.startScreenRecording, with an audio option that is off by default. Its older page.screencast(), now marked obsolete in favour of page.record(), defaults to WebM with VP9 at 30 fps and needs FFmpeg installed.
Use recording when you want to see what a page did, such as a failing test. When the file is the product, render frame by frame instead, so a slow frame waits rather than vanishing.
When is screen recording the right way?
When the page has to run in real time: a live demo, real playback, or anything you cannot seek. OBS Studio is free and open source software for recording and streaming, under the GPL v2 or later. It records scenes built from sources, such as a web page in a browser source, with the page's sound. Inside a page, the browser's own getDisplayMedia() captures a screen, window or tab, and MDN notes that browsers may include audio, with support that varies.
The take is the take, so check it. In AdAnt's OBS Recording skill, a browser source that was not showing took about 0.6 s to draw again, so each scene switch first recorded 0.63 s of black. Keeping every page live in every scene fixed it: the take came out at 14.03 s, 421 frames, none skipped, with each cut within a hundredth of a second of its requested time. The skill's own rule is the one to keep: if a page can render any frame on demand, capture it frame by frame instead.
How do the HTML-to-video approaches compare?
Seeking wins on repeatability, recording on anything live; license and audio decide the rest.
| Approach | How it captures frames | Deterministic or real time | Audio | License | Best for |
|---|---|---|---|---|---|
| HyperFrames | Seeks a paused timeline per frame in headless Chrome; FFmpeg encodes | Deterministic | Mixed from the page's audio and video elements | Apache 2.0 | HTML pages an agent writes: promos, launch videos, explainers |
| Remotion | Renders each frame of React components in Chrome Headless Shell, in parallel tabs | Deterministic when every animation reads useCurrentFrame() | Its Video and Audio components | Remotion License: free up to 3 people, paid above | React teams and data-driven templates rendered many times |
| Puppeteer or Playwright screenshots + FFmpeg | Your script sets the time, takes a screenshot, FFmpeg joins the stills | Deterministic only if the page draws from time alone | None from the screenshots; add a track when encoding | Apache 2.0; FFmpeg LGPL 2.1 or later | A page you wrote with a renderAt(t) function |
| Puppeteer or Playwright recording | The browser records the page as it plays | Real time | Puppeteer's page.record() option, off by default; none in Playwright | Apache 2.0 | Quick captures of a test run or demo |
| Screen recording (OBS Studio) | Records scenes of sources, such as a browser source, as they play | Real time | Yes | GPL v2 or later | Live demos and pages you cannot seek |
Which HTML-to-video method should you use?
Start from who writes the page and whether it can be seeked.
- An agent or a designer is writing the page now, in plain HTML. Use HyperFrames. It brings the timing rules, the checks and the renderer.
- Your team writes React, or one template meets data many times. Use Remotion, and check the license first if your company has more than 3 people.
- The page already exists and you can add a function that draws any moment. Write a Puppeteer or Playwright screenshot loop and encode with FFmpeg. You keep full control and learn no new framework.
- The page has to play live. Record it, then check the file for its length, dropped frames and sound before you use it.
AdAnt, an AI social media marketing team, keeps skills on each of these routes in its library, because they solve different videos: a data-bound promo in HyperFrames, a narrated explainer in Playwright, a live demo in OBS.
Frequently asked questions
Can I convert an HTML animation to MP4 for free?
Yes. HyperFrames, Puppeteer and Playwright are Apache 2.0, FFmpeg is LGPL 2.1 or later, and OBS Studio is GPL v2 or later. Remotion is free for individuals and companies of up to 3 people; larger companies need its paid Company License.
Why does my recorded video stutter or skip frames?
A recorder saves what the page draws in real time, so a busy machine drops frames and every take differs. Render the page frame by frame instead, so each frame waits as long as it needs.
Will a CSS animation come out right?
In HyperFrames, yes: CSS is one of the animation runtimes it seeks. In a homemade screenshot loop, pause each animation from document.getAnimations() and set its currentTime before every screenshot. Playwright's clock API alone will not do it: it takes over timers and requestAnimationFrame, but CSS animations are not on its list.
Can I turn a live website into a video?
Record it if it has to play live. Or run npx hyperframes capture with the URL, which pulls a public site's screenshots, assets and fonts into a folder an agent can build a video from. It refuses private and loopback addresses.
Is Remotion or HyperFrames better for HTML to video?
HyperFrames takes plain HTML with no build step and is Apache 2.0. Remotion takes React components, has the more mature cloud renderer and charts a license fee above 3 people. Pick by who writes the video and who pays.
