Skip to content
Search

Chrome-capture

lastmod 2026-11-18created 2026-11-182 edits

chrome-capture is a Chrome tab recording tool by Paul Irish that saves a tab's video and audio directly to an AV1 MP4. It wraps the CDP command Page.startScreenRecording added in Chrome 153, and because encoding happens inside the browser while recording, it does not need ffmpeg. Compared with the older approach of receiving JPEG frames and stitching them together with ffmpeg, as in Playwright's recordVideo or Puppeteer's page.screencast(), it captures more frames and takes less time to stop a recording.

About

  • Page.startScreencast, which underlies the older approach, is an API created around 2013 so DevTools could preview the screen of an Android device connected over USB. Each frame is JPEG-encoded, sent as base64 in CDP JSON, and acknowledged before the library hands it to ffmpeg
  • Page.startScreenRecording sends the compositor's frames through shared memory to an encoder in a separate process, and Chrome writes AV1 into the MP4 as it records. Since encoding is already done, stopping a recording finishes almost instantly
  • CLI: npx chrome-capture <URL> demo.mp4 4s. The default is 720p at 60fps with tab audio. Use --fps=120 --width=1920 --height=1080 --headful for high-refresh-rate recording, and --with-devtools to record the screen with DevTools open
  • At 60fps or below it runs headless; on macOS, going above 60fps automatically switches to headful mode to match the 120Hz ProMotion display
  • The library API startRecording() accepts a Playwright Page, a Puppeteer Page, or a CDP session. The file is written when the await using block exits, so recording can cover only the needed part after login and page setup are done
  • A @playwright/test fixture records every test and attaches the MP4 to the report. Cursor and click indicators can be recorded too with Playwright's page.screencast.showActions(), or a custom cursor overlay can be added
  • Comparison recording the same 6.4-second UI playback (1280x800) on an M4 Max: output 25fps→60fps, stop and finalize 3,800ms→17ms, WebSocket traffic 10.5MB→450KB, file size 480KB→330KB, total time 21s→11s. At 2160p, stopping went from 20.5s→91ms
  • No bitrate or CRF settings yet. Chrome encodes with libaom AV1 in real-time 1-pass VBR mode and raises the bitrate in proportion to pixel rate (2Mbps at 720p30, 9Mbps at 1080p60, 72Mbps at 2160p120). If lossless quality down to 1px text is needed, PNG screencast + ffmpeg is still the better choice
  • Measured upper limits: 2160p 60fps headless on Mac, 2160p 120fps headful on a 120Hz ProMotion Mac, 1080p 60fps on headless Linux without a GPU (75 to 83fps with vsync disabled). Windows has not been measured yet
  • Puppeteer v25.10 and later offers the same API as the experimental feature page.record(); on the Playwright side a PR is in progress
  • Requires Chrome or Chromium 153+ and Node.js 24.11+. npm package chrome-capture. Apache-2.0 license

See also

Favorite site

author MCPBot sitemap