interfaceextends SharedCaptureOptions
RecordingOptions
typescript
interface RecordingOptions extends SharedCaptureOptionsProperties
| Name | Type | Description |
|---|---|---|
bufferSeconds | number | Keep last N seconds in memory instead of streaming to file. When stopRecording() is called, the buffer is encoded to the output file. Maximum 30 seconds. Memory usage depends on resolution and fps — each frame uses width * height * 4 bytes (e.g. ~8 MB at 1080p). |
captureRegion? | Region | Capture only a specific region of the screen. When set, uses screen.grabRegion() instead of screen.grab(). |
fps? | number | Frames per second (default: 30) |
height? | number | Frame height - uses first frame's height if not specified |
onError? | (error: unknown) => void | Called when an error occurs during frame capture. |
resolutionMode? | "pad-crop" | "drop" | How to handle frames whose dimensions differ from the target. - "drop": skip mismatched frames (default) - "pad-crop": normalize to target dimensions — smaller frames are padded with black, larger frames are cropped. |
showCursor? | boolean | Whether to draw cursor on the recording (default: true) |
skipMemoryCheck? | boolean | Skip the buffer memory cap check. Use this when recording high-resolution screens (e.g. 6K) where you know the system has enough memory. |
width? | number | Frame width - uses first frame's width if not specified |
Was this page helpful?