Playbook 02 · Deterministic Motion Media

Programmatic Product Launch Video with GSAP, Playwright & FFmpeg

How to ship pixel-sharp 60fps launch reels in 16:9 and 9:16 straight from version-controlled HTML/CSS/GSAP templates—with zero dropped frames, no After Effects bottlenecks, and instant pricing or copy edits.

Executive Summary · Why Code Beats Screen Recording

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–2 stays razor sharp after libx264 CRF 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.

STAGE 01 · TIMELINE Paused GSAP Master Clock

Initialize gsap.timeline({ paused: true }) and expose window.seek(t) globally.

STAGE 02 · STEPPER Playwright Frame Loop

Step t = i / 60, wait two animation ticks for paint settle, capture lossless PNG.

STAGE 03 · ENCODER FFmpeg Broadcast Mux

Encode PNG sequence to yuv420p MP4 with +faststart atom relocation.

stage.js — Deterministic Paused Timeline Driver
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).

capture.mjs — Frame-Accurate Headless Chromium Exporter
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();
encode.sh — Universal Social & Web Player MP4 Command
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
Interactive Pipeline Calculator

Deterministic Frame Budget & Storyboard Scrubber

window.seek(t) Simulator
Target Aspect Ratios
Total PNG Frames 2,160 frames ~90s capture + encode
Estimated MP4 Output 22.3 MB (2 MP4) YUV420p +faststart
window.seek(4.50) · Frame 270 / 1080 CFR Locked

Beat 02 · Live UI Telemetry & Product Walkthrough

Frame-locked viewport cursor sweep, KPI counter interpolation, and metric callouts.

Generated Capture + FFmpeg CLI

              

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.

Need 16:9 + 9:16 60fps Launch Videos Shipped in 48 Hours?

Skip $2,500+ motion retainer delays. Get broadcast MP4 renders plus the full editable code templates you can re-render whenever your UI ships new features.