Expand description
Video encoding via ffmpeg subprocess (matches Playwright’s approach).
Spawns ffmpeg CLI and pipes JPEG frames to stdin. No compile-time
ffmpeg/libav dependency – the binary just needs ffmpeg on PATH at
runtime when --video is used.
Codec selection matches Playwright: VP8/WebM by default, fallback to libx264/MP4 if VP8 is unavailable.
Functions§
- encode_
frames - Batch encode: pipe all frames at once (for deferred/buffered recording).
- encode_
stream - Channel-driven encoding: pipe JPEG frames to ffmpeg subprocess as they arrive. Runs on a blocking thread concurrently with the test.
- video_
content_ type - Return the correct MIME type based on available encoder.
- video_
extension - Return the correct file extension based on available encoder.