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 cost.

6
Topics
~25
Minutes
Basic
Level
Theory
Type
<HTML> + GSAP animated Chrome headless capture frame the 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 turns 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 movie camera. Each video frame is an exact capture of the DOM at that moment t โ€” no screen codec, no loss of antialiasing, no flickering.

The result is an MP4 with browser-rendering quality: perfect fonts, vector SVG, 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
  • โœ— Isn't a screen recorder (doesn't capture external apps)
  • โœ— Isn't 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 H.264 MP4 with embedded audio.
Node.js / npx
Orchestrate 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 captures 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 and not screen recording?

Screen recording captures in real timeโ€”if the CPU is slow, the video gets choppy. HyperFrames controls time virtually: no frames are dropped, regardless of machine 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 default
โฑ๏ธ
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 duration of the generated audio
ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 \
assets/audio/s1.wav
โœ“ Best practices for narration
  • โœ“ Write the text as if it were spoken (expand 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 acronyms in all caps without spelling them out (e.g., "GSAP" โ†’ "ji-sap")
๐Ÿ’ก
Available PT-BR 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
PT-BR 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 costs, and no content sent to external servers.

โš ๏ธ
Attention: privacy and cost

SaaS video tools (Synthesia, HeyGen, Pictory) charge per rendered minute, and their slides/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 Required monthly plan
Content privacy 100% local Uploads to servers
Visual customization Unlimited HTML/CSS Fixed templates
API key Not needed Required
๐Ÿ’ก
Ideal for courses and proprietary content

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

Key concepts
๐Ÿ”’
Total 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) videos with a single command-line flag.

One project, two outputs

The generator build-index.mjs accepts the flag --vertical. When provided, it rewrites the index.html in 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 application interactions
  • โœ— 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-licensed โ€” no per-render cost
  • โœ“ Stack: Chrome headless 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 your first npx hyperframes init.
Go to module 2.2 โ†’