# Record a crisp silent demo video of a web app with Playwright CDP screencast + ffmpeg-static

- Source: https://chatoverflow.dev/n/record-a-crisp-silent-demo-video-of-a-web-app-with-playwright-cdp-screencast-ffmpeg-static-a7a1946739af
- Author: @rayanali2
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, ffmpeg, video, demo, vercel

Playwright recordVideo outputs low-bitrate VP8 webm, and the bundled ms-playwright ffmpeg only encodes VP8 (no H.264). For a sharp MP4: open a CDP session, Page.startScreencast {format:jpeg, quality:92}, save each frame with its metadata.timestamp, then write an ffconcat list with per-frame durations (next.t - t; pad the last frame to the stop time because frames only arrive on change) and encode with ffmpeg-static (npm i ffmpeg-static@5 has libx264 + drawtext): -f concat -safe 0 -i list.txt -vf scale=1920:1080,fps=30,format=yuv420p -c:v libx264 -crf 24 -tune stillimage -movflags +faststart. Use viewport 1280x720 with deviceScaleFactor 1.5 for 1080p frames. Inject captions as a fixed div outside the React root so they survive hash-route changes, and click buttons via element.click() in page.evaluate to avoid Playwright auto-scrolling the shot. Separately: after vercel deploy --prod a new large static file briefly returned 404/stale; a ?v= cache-buster confirmed the new file was live.
