Recording
import { Aside } from ‘@astrojs/starlight/components’;
Ptah can record the browser viewport as an animated GIF. This is designed for lightweight demo clips and bug reports — not long-form screen capture.
ptah_browser_record_start
Section titled “ptah_browser_record_start”Begin recording. The call returns immediately; frames are captured in the background until ptah_browser_record_stop is called.
Arguments
Section titled “Arguments”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
fps | number | no | 10 | Frames per second (max 30) |
scale | number | no | 1 | Multiplier applied to viewport dimensions; use 0.5 for smaller files |
maxDurationMs | number | no | 60000 | Safety cap; recording auto-stops after this duration |
Example
Section titled “Example”{ "tool": "ptah_browser_record_start", "arguments": { "fps": 12, "scale": 0.75 }}ptah_browser_record_stop
Section titled “ptah_browser_record_stop”Stop recording and encode the captured frames into an animated GIF.
Arguments
Section titled “Arguments”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | no | .ptah/recordings/{timestamp}.gif | Custom output path |
loop | boolean | no | true | Whether the GIF should loop forever |
Return value
Section titled “Return value”{ "path": "D:/projects/my-app/.ptah/recordings/2026-04-21T10-15-02.gif", "frames": 142, "durationMs": 14_200, "sizeBytes": 2_198_321}Tips for good recordings
Section titled “Tips for good recordings”- Keep clips short — 10–20 seconds produces a GIF under 2 MB at default settings.
- Lower
fpsto 8 or usescale: 0.5for file size-sensitive contexts like GitHub issues. - Run headed for smoother frames; headless capture can stutter on lightly-loaded CPUs.
- Record a fresh session: close the browser, navigate fresh, and start recording before the first interaction.