This directory contains a standalone tool for generating synthetic frame sequences using Headless Chrome. These sequences are used to stress-test and benchmark video encoders (like AV1) in the Chrome Remote Desktop context.
Note: This tool is currently supported on Linux and Mac only.
The tool uses the Chrome DevTools Protocol (CDP) to drive a headless instance of Chrome. It loads a “scenario” (an HTML/JS file), advances time deterministically, and captures screenshots for each frame.
python3 remoting/test/frame_generator/frame_generator.py \ --scenario <name> \ --out-dir <path> \ --frames 100 \ --fps 30 \ --width 1920 \ --height 1080
--scenario: The name of the HTML file in the scenarios/ directory (without .html).--out-dir: Directory where the generated PNG frames will be saved.--frames: Number of frames to generate (default: 100).--fps: Frame rate for the generated sequence (default: 30.0).--width/--height: Dimensions of the capture window (default: 1920x1080).--chrome-path: Path to the Chrome binary (default: out/Release/chrome).When creating a new scenario in scenarios/, you must adhere to the following technical contract:
window.setBenchmarkTime(t). This function is called by the Python script to advance the scene to a specific point in time t (in seconds).Math.random(). Use a deterministic seeded random number generator (e.g., an LCG) to ensure identical output across different runs and machines.animate(t) loop using requestAnimationFrame that calls your render logic. This allows the scenario to “auto-play” when opened manually in a browser for debugging.--remote-debugging-pipe.window.setBenchmarkTime(t) function within the loaded HTML page. This ensures that even animations are deterministic relative to the frame index.Page.captureScreenshot command to get the raw pixel data.