PTENES
MODULE 2.1

🎬 What HyperFrames Is

Understand from scratch the open-source framework that converts animated HTML into MP4 using headless Chrome and FFmpeg—all on your machine, with no cloud and no per-render costs.

6
Topics
~25
Minutes
Basic
Level
Theory
Type
<HTML> + GSAP animated Chrome headless capture frame a frame FFmpeg encodes .mp4 ① DESIGN ② RENDER ③ ENCODE 🔊 Kokoro TTS pf_dora · PT-BR · --speed 0.98 · no key · no espeak-ng HyperFrames HTML → MP4 · LOCAL · OPEN SOURCE
1

🎯 What HyperFrames Is

HyperFrames is an open-source framework that transforms animated HTML pages into MP4 files, frame by frame, with complete precision. Official repository: heygen-com/hyperframes on GitHub.

Main Concept

HyperFrames treats the browser like a film camera. Each video frame is an exact capture of the DOM at the moment t — no screen codec, no loss of antialiasing, no flickering.

The result is an MP4 with browser-rendering quality: perfect fonts, vector SVG, and shadows and gradients without degradation.

✓ What HyperFrames IS
  • ✓ Open-source framework (MIT), free forever
  • ✓ Runs 100% locally: no account, no API key
  • ✓ Deterministic output: same HTML → same MP4
  • ✓ Integrates with any JS library: GSAP, Three.js, D3
✗ What HyperFrames IS NOT
  • ✗ It’s not a screen recorder (doesn’t capture external apps)
  • ✗ It’s not a nonlinear video editor (no GUI timeline)
  • ✗ Doesn’t depend on a cloud service
  • ✗ Doesn’t use generative AI for images or voices
📦 Exact tech stack
Headless Chrome
Renders the HTML and captures screenshots in sequence, frame by frame.
FFmpeg
Encodes the captured frames into an H.264 MP4 with embedded audio.
Node.js / npx
Orchestrates the pipeline: init → lint → render — all via npx hyperframes.
Key concepts
🌐
Open-source
MIT license
💻
Local-first
No cloud
🎞️
Frame by frame
Maximum quality
⚡
npx CLI
Zero config
2

🔄 HTML → MP4

How an animated HTML page with GSAP becomes an MP4 video rendered frame by frame — the heart of HyperFrames.

Transformation workflow
1
You write HTML + GSAP

One file index.html defines each scene with HTML/CSS. The animations are coded in GSAP inside a function anim() that receives t (time in seconds).

2
Headless Chrome "advances time"

For each frame, HyperFrames calls anim(t) in the browser, waits for the DOM to stabilize, and triggers a high-resolution PNG screenshot. At 30 fps, that's 30 screenshots per second of video.

3
FFmpeg encodes the frames

The PNGs are passed to FFmpeg, which encodes them in H.264 with the WAV audio generated by Kokoro TTS — producing the final MP4 with synchronized narration.

4
MP4 ready to publish

The resulting video is saved in renders/nome-16x9.mp4 or renders/nome-9x16.mp4, ready to upload to YouTube or Shorts.

💡
Why frame by frame instead of screen recording?

Screen recording captures in real time—if the CPU is slow, the video comes out broken. HyperFrames controls time virtually: no frames are lost, regardless of the machine's speed.

Structure of the anim() function
// build-index.mjs (scene 1 excerpt)
function scene1() {
return `<div class="scene">...</div>`;
}

function anim(t) {
// t = time in seconds within the scene
if (t === 0) gsap.set(...);
gsap.to('.title', { opacity: 1, duration: 0.5 });
}
Key concepts
🖼️
Captured frame
30 fps standard
⏱️
Virtual time
No CPU lag
🎨
GSAP
Smooth animations
🎞️
H.264 MP4
Final output
3

🔊 Local TTS with Kokoro

PT-BR narration generated 100% on your machine, with the voice pf_dora, with no API key and no dependency on espeak-ng. Kokoro handles Portuguese phonetics.

Why Kokoro and not another engine?

Most open-source TTS engines use espeak-ng for phonemization — and espeak-ng is notoriously poor at Portuguese. Kokoro has its own PT-BR phonemizer, producing more natural speech without external dependencies.

Exact command (narration-template.sh)
# Generates narration for scene 1
npx hyperframes tts "assets/txt/s1.txt" \
--voice pf_dora \
--speed 0.98 \
--output assets/audio/s1.wav

# Measure the generated audio duration
ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 \
assets/audio/s1.wav
✓ Narration best practices
  • ✓ Write the text as if it were spoken (spell out acronyms)
  • ✓ Use --speed 0.98 for a more natural voice
  • ✓ Measure each WAV with ffprobe before assembling
  • ✓ Text files in assets/txt/sN.txt
✗ Common errors
  • ✗ Don’t install espeak-ng — Kokoro doesn’t use it, and it causes conflicts
  • ✗ Don’t use a speed above 1.05 (metallic voice)
  • ✗ Don’t forget to download the model on the 1st run (~340 MB)
  • ✗ Don't use uppercase acronyms without spelling them out (e.g., "GSAP" → "jee-sap")
💡
Available Brazilian Portuguese voices

Beyond pf_dora (female, recommended default), there is pm_alex e pm_santa. The first run automatically downloads ~340 MB of the Kokoro model.

Key concepts
🎙️
pf_dora
Brazilian Portuguese voice
🚫
No espeak-ng
Native phonetics
🔑
No key
Zero config
📁
WAV output
assets/audio/
4

💻 All local, no API

HyperFrames runs entirely on the user’s machine — no cloud, no per-render cost, and no content sent to external servers.

⚠️
Warning: privacy and cost

SaaS video tools (Synthesia, HeyGen, Pictory) charge per rendered minute, and your slides and scripts are processed on third-party servers. With HyperFrames: zero cost per render, and no content leaves your machine.

HyperFrames vs. video SaaS
Aspect HyperFrames SaaS (Synthesia etc.)
Cost per video R$ 0,00 Monthly plan required
Content Privacy 100% local Uploads to servers
Visual customization Unlimited HTML/CSS Fixed templates
API key Doesn’t need to Required
💡
Ideal for courses and proprietary content

If you produce courses with sensitive content, internal code, or proprietary methodologies, keeping everything local is essential. Each render happens without requiring an internet connection.

Key concepts
🔒
Complete Privacy
Zero external data
💸
Zero cost/render
Unlimited
🌐
Offline-capable
No internet
5

📐 Two formats: 16:9 and 9:16

From the same HTML project, HyperFrames generates YouTube (1920×1080) and Shorts/Reels (1080×1920) with a single command-line flag.

One project, two outputs

The generator build-index.mjs accepts the flag --vertical. When passed, it rewrites the index.html at 1080×1920, and HyperFrames renders the vertical MP4 — without duplicating scene code.

Render commands (both formats)
# 16:9 — YouTube (1920×1080)
node build-index.mjs &&
npx hyperframes render --quality high \
--output renders/meu-video-16x9.mp4

# 9:16 — Shorts / Reels (1080×1920)
node build-index.mjs --vertical &&
npx hyperframes render --quality high \
--output renders/meu-video-9x16.mp4
📊 Dimensions and destinations
16:9 — Horizontal
Resolution: 1920 × 1080 px
Destination: YouTube, Vimeo, LinkedIn
Flag: node build-index.mjs (without a flag)
9:16 — Vertical
Resolution: 1080 × 1920 px
Destination: YouTube Shorts, Instagram Reels, TikTok
Flag: node build-index.mjs --vertical
💡
Workflow tip

Use --quality draft first to check individual frames quickly. Only then run --quality high for the final MP4 — saves time during iterations.

Key concepts
📺
1920×1080
YouTube
📱
1080×1920
Shorts/Reels
🚩
--vertical
Single flag
🔁
Reuse
Same project
6

🧭 When to use HyperFrames

Explainer videos, technical tutorials, product onboarding — any situation where you want full control over the visuals and zero cost per render.

✓ Use HyperFrames when...
  • ✓ Create explanatory videos about code or technical concepts
  • ✓ Create step-by-step tutorials with precise animations
  • ✓ Build product onboarding with its own brand design
  • ✓ Need 16:9 AND 9:16 from the same content
  • ✓ Want zero cost, even in high-volume production
✗ Prefer another tool when...
  • ✗ Need to capture real interactions in applications
  • ✗ The video requires a talking-head camera (realistic avatar)
  • ✗ Complex nonlinear editing (Adobe Premiere / DaVinci)
  • ✗ No Node.js available in the environment
Typical use cases in INEMA.CLUB
🎓
Course videos

Animated slides with code, diagrams, and local narration. Same quality every time, with no platform variation.

🚀
Product onboarding

Welcome videos and feature tours with the brand’s premium dark design — without relying on designers or SaaS.

📢
Releases

Product teaser in 9:16 for Reels and 16:9 for YouTube — generated from the same HTML in minutes.

💡
Golden Rule

If you can describe the video as "slides with animations + narration," HyperFrames is the right tool. If you need a live camera or app capture, use screencast.

Key concepts
🎬
Explainer
Technical video
🎓
Tutorial
Step by step
🚀
Onboarding
Product/SaaS
🎯
Full control
Freeform HTML/CSS

📋 Module 2.1 summary

What you learned
  • ✓ HyperFrames is open source, local, MIT — no cost per render
  • ✓ Stack: headless Chrome captures frames + FFmpeg encodes MP4
  • ✓ HTML + GSAP → function anim(t) → frames → MP4
  • ✓ Kokoro TTS: pf_dora --speed 0.98, no espeak-ng, no key
  • ✓ 16:9 (1920×1080) and 9:16 (1080×1920) from the same project
  • ✓ Ideal for explainers, tutorials, and onboarding with custom design
Next module
2.2
🛠️ Setup & prerequisites
Install Node.js, Chrome, FFmpeg, and the HyperFrames CLI. Set up the environment from scratch through the first npx hyperframes init.
Go to module 2.2 →