playwright-recast
Transform Playwright traces into stunning demo videos — automatically.

Website · Documentation · Release notes · Changelog
Your Playwright tests already capture everything — traces, screenshots, network activity, cursor positions. playwright-recast turns those artifacts into polished, narrated product videos with a single fluent pipeline.
https://github.com/user-attachments/assets/418d996d-2e18-4ae8-9ccc-3e5161dc7af8
SHOWCASE
Neo4j

Snowflake Cortex Neo4j Agent Integration — see a real agent workflow spanning Snowflake Cortex and Neo4j presented as a polished product video.
A huge thank you to @Andy2003 for the outstanding, long-term contributions that have helped shape playwright-recast.
Why?
Recording product demos is painful. Every UI change means re-recording. Manual voiceover and subtitling takes hours. Timing is always off.
playwright-recast flips this:** your Playwright tests become your video source.** Write tests once, regenerate polished videos on every deploy.
import { Recast, ElevenLabsProvider } from 'playwright-recast'
await Recast
.from('./test-results/trace.zip')
.parse()
.speedUp({ duringIdle: 3.0, duringUserAction: 1.0 })
.subtitlesFromSrt('./narration.srt')
.voiceover(ElevenLabsProvider({ voice: 'daniel' }), { normalize: true })
.render({ format: 'mp4', resolution: '1080p' })
.toFile('demo.mp4')
That's it. Trace in, polished video out.
Features
- Fluent pipeline API — Chainable, immutable, lazy-evaluated. Build complex pipelines that read like English.
- Trace-based processing — Parses Playwright trace.zip (actions, screenshots, network, cursor positions). No manual recording needed.
- Smart speed control — Automatically speeds up idle time, network waits, and navigation while keeping user actions at normal speed.
- TTS voiceover — Generate narration with OpenAI TTS, ElevenLabs, or Amazon Polly. Properly timed with silence padding.
- Subtitle generation — SRT, WebVTT, and ASS output. Import external SRT or generate from trace BDD step titles.
- Styled subtitle burn-in — Configurable font, size, color, background box with opacity, padding, position. Smart punctuation-based chunking for single-line display.
- playwright-bdd support — First-class integration with playwright-bdd Gherkin steps. Doc strings become voiceover narration.
- Click highlighting — Animated ripple effect at click positions with optional click sound. Configurable color, opacity, radius, duration.
- Cursor overlay — Animated cursor travels between click positions with configurable duration, easing, and post-arrival visibility. Bundled arrow cursor or custom image.
- Animated zoom with easing — Auto-zoom uses customizable easing functions (ease-in-out, ease-out, cubic-bezier, or custom JS functions) with smooth zoom-to-zoom panning.
- Visual direction with Jev —
.direct(JevDirector(), { goal }) watches the rendered recording (pixel changes + local OCR) and picks camera moves, emphasis and pacing from bounded candidates. No manual zoom() or highlight() calls needed.
- Multi-page recordings - Popups (
window.open, OAuth consent) and new tabs are cut into one video from Playwright's per-page videos: popups over the darkened page behind, tabs as a hard switch, configurable with .pages(). Clicks, cursor, zoom and highlights follow the page.
- Mouse and keyboard input -
cursorOverlay({ mouseIndicator }) puts a small mouse icon beside the cursor for pressed buttons and wheel turns; .keyOverlay() shows shortcuts and held modifiers as a keycap. Both choose inputs globally and per interaction with withMouseIndicator() / withKeyOverlay().
- URL bar -
.urlBar() shows the URL of the page on screen as a pill: on host changes, always, or at showUrl() markers, with query stripping and redaction.
- Frame interpolation — Smooth out choppy browser recordings with ffmpeg minterpolate. Blend, duplicate, or motion-compensated modes with multi-pass support.