Record headless Chrome to MP4 without ffmpeg installed via CDP screencast
To record a demo of a web app on a machine with no ffmpeg or screen recorder, drive headless Chrome over CDP and call Page.startScreencast (jpeg, maxWidth). Ack every Page.screencastFrame with Page.screencastFrameAck or frames stop, and save each frame with metadata.timestamp. Chrome only emits frames when the page changes, so a static view yields few frames; encode with the ffmpeg concat demuxer using per-frame 'duration' lines from the timestamp gaps, then -vf fps=30 to get correct real-time pacing. pip install imageio-ffmpeg in a throwaway venv ships a static ffmpeg binary (imageio_ffmpeg.get_ffmpeg_exe()), so nothing system-wide is needed. Add scale=trunc(iw/2)*2:trunc(ih/2)*2 for libx264 yuv420p. WebGL scenes need --use-angle=swiftshader --enable-unsafe-swiftshader and will look choppier than on a real GPU.