B2B SaaS teams waste weeks re-recording OBS demos or waiting on $3,000 motion-agency exports every time a dashboard metric or pricing tier changes. Treating video as code turns a launch reel into a reproducible CI artifact.
- Zero wall-clock jitter: Pausing a GSAP timeline and calling
window.seek(frame / fps)gives Chromium exact rasterization time per frame. - Multi-aspect from one source: One semantic DOM + JSON data object renders both 16:9 LinkedIn/YouTube widescreen and 9:16 vertical social cuts.
- Clean UI crispness: Vector DOM typography rendered at
deviceScaleFactor: 1–2stays razor sharp afterlibx264CRF 18 encoding.
1. The Deterministic window.seek(t) Architecture
Standard browser video recorders capture frames asynchronously using MediaRecorder or real-time requestAnimationFrame. Whenever Chromium hits garbage collection or font rasterization, the exported MP4 exhibits micro-stutters. Deterministic capture flips the loop inside out: Playwright owns the clock.
Initialize gsap.timeline({ paused: true }) and expose window.seek(t) globally.
Step t = i / 60, wait two animation ticks for paint settle, capture lossless PNG.
Encode PNG sequence to yuv420p MP4 with +faststart atom relocation.
const tl = gsap.timeline({ paused: true });
tl.from('.headline-word', { y: 28, opacity: 0, stagger: 0.06, duration: 0.45, ease: 'power3.out' }, 0)
.to('.telemetry-panel', { scale: 1, opacity: 1, duration: 0.6, ease: 'expo.out' }, 1.2)
.to('.kpi-counter', { innerText: 94, snap: { innerText: 1 }, duration: 0.9 }, 2.1);
window.seek = (seconds) => {
tl.time(seconds, false);
return new Promise((resolve) => {
requestAnimationFrame(() => requestAnimationFrame(resolve));
});
};
2. Playwright Stepping & FFmpeg Broadcast Encoding
In Playwright, disable CSS transitions that run outside the timeline, wait for document.fonts.ready, and iterate frame indices sequentially. Writing PNG buffers straight to disk or piping raw RGBA frames into FFmpeg keeps memory flat even on 60-second 60fps renders (3,600 frames).
import { chromium } from 'playwright';
const FPS = 60;
const DURATION = 18;
const TOTAL = FPS * DURATION;
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1920, height: 1080 } });
await page.goto('http://127.0.0.1:4173/reel.html', { waitUntil: 'networkidle' });
await page.evaluate(() => document.fonts.ready);
for (let frame = 0; frame < TOTAL; frame++) {
const t = frame / FPS;
await page.evaluate((sec) => window.seek(sec), t);
const idx = String(frame).padStart(5, '0');
await page.screenshot({ path: `frames/${idx}.png`, animations: 'allow' });
}
await browser.close();
ffmpeg -y -framerate 60 -i frames/%05d.png \
-c:v libx264 -profile:v high -level 4.2 \
-pix_fmt yuv420p -crf 18 -preset slow \
-movflags +faststart launch_16x9_60fps.mp4
3. Video Pipeline Frequently Asked Questions
Why is window.seek(t) frame capture superior to OBS or browser screen recording?
Real-time screen recording relies on wall-clock rendering, which drops frames during heavy CSS blur or SVG transforms. Paused timeline stepping via window.seek(t) gives the browser unlimited milliseconds per frame to finish layout and paint before capturing an exact PNG.
Can one HTML/GSAP template export both 1920x1080 widescreen and 1080x1920 vertical MP4s?
Yes. CSS container queries or a root aspect-ratio class switch the stage layout between 16:9 desktop frames and 9:16 portrait frames while sharing the same timeline beats and copy tokens.
Which FFmpeg flags guarantee crisp UI typography across LinkedIn, X, and Safari?
Using -c:v libx264 -pix_fmt yuv420p -crf 18 -movflags +faststart with an exact constant framerate (-framerate 60) ensures universal browser/social playback and crisp text edges.
What does the $149 EVSM 48h Video Sprint deliver?
It delivers 60fps 16:9 (1920x1080) and 9:16 (1080x1920) MP4 launch renders plus the complete editable HTML, CSS, GSAP, and Playwright capture templates within 48 hours.