start_recording
Starts a background screen recording of the full desktop, a monitor, window, or region and returns a session ID and output path. Stop it with stop_recording to finalize the video.
Instructions
Start a screen recording (Windows gdigrab) as a background ffmpeg process. Returns a session id and output path. Recording is explicit and never auto-starts. Use stop_recording with the id to finalize the file. Audio is video-only by default; set audio.source = 'system' to also capture system (loopback) audio. Microphone capture is not supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | Frames per second (default 30). | |
| keys | No | With events: masked (default) logs typing only as bursts (start and length on a 0.5 s grid), never which keys or when each one was pressed. shortcuts also names chords made with Ctrl, Alt, or Win (e.g. Ctrl+S), with their times; typed text is never logged. | |
| audio | No | Audio capture (default none, video-only). source 'system' needs a loopback device; microphone capture is not supported. | |
| events | No | Also log mouse clicks, scroll, cursor positions, and typing to <recording>.events.jsonl, timed to the video and in video pixels (default false). Read it with read_events. Adds about a second to start. | |
| output | No | Optional output .mp4 path. Defaults to a file under SCREENCAST_HOME/recordings. | |
| target | Yes | Capture target: 'full' | 'monitor:<index>' (0 = primary) | 'window:<title>' (or window:exe=<app.exe> / window:hwnd=<handle>, without relying on the title) | 'region:<x>,<y>,<w>,<h>' (absolute pixels). window: records the on-screen rectangle the window occupies, resolved ONCE at start (it must be visible, on top, not minimized); it does not follow a window moved or resized mid-recording. | |
| backend | No | gdigrab (default) records the screen rectangle. wgc (window: targets, FFmpeg 8+) records the window's own surface through Windows Graphics Capture: it keeps recording the window when it is covered, moved, or in the background, and frames only its client area. No audio with wgc. | |
| quality | No | Encoder preset (default standard). | |
| overwrite | No | Allow replacing an existing file at the output path (default false). | |
| exactTitle | No | For window: targets, match only a window whose title equals the given title (case-insensitive); never fall back to a substring match. Default false. | |
| maxDurationSec | No | Stop automatically after this many seconds, finalizing the file (default 3600, or SCREENCAST_MAX_RECORDING_SEC; at most 604800, 7 days). 0 = no cap. A safety net against a recording that is never stopped. |