A REST API server to start, stop, and download screen recordings.
- Go 1.27.3+ - Programming language runtime
- ffmpeg - Video recording engine
- macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpegorsudo yum install ffmpeg
- macOS:
- pnpm - For OpenAPI code generation
npm install -g pnpm
- macOS: Uses AVFoundation for screen capture
- Linux: Uses X11 for screen capture
- Windows: Not currently supported
make devThe server will start on port 10001 by default and log its configuration.
# 1. Start a new recording
curl http://localhost:10001/recording/start -d {}
# (recording in progress)
# 2. Stop recording
curl http://localhost:10001/recording/stop -d {}
# 3. Download the recorded file
curl http://localhost:10001/recording/download --output recording.mp4Configure the server using environment variables:
| Variable | Default | Description |
|---|---|---|
PORT |
10001 |
HTTP server port |
METRICS_PORT |
10002 |
Prometheus metrics port (GET /metrics) |
FRAME_RATE |
10 |
Default recording framerate (fps) |
DISPLAY_NUM |
1 |
Display/screen number to capture |
MAX_SIZE_MB |
500 |
Default maximum file size (MB) |
OUTPUT_DIR |
. |
Directory to save recordings |
FFMPEG_PATH |
ffmpeg |
Path to the ffmpeg binary |
KERNEL_METRO_API_BASE_URL |
Metro API base URL; answers the WebAuthn page hook (PUT /webauthn/hook) |
|
KERNEL_INSTANCE_JWT |
Instance credential sent to the metro API and the OTLP relay |
export PORT=8080
export FRAME_RATE=30
export MAX_SIZE_MB=1000
export OUTPUT_DIR=/tmp/recordings
./bin/api- YAML Spec:
GET /spec.yaml - JSON Spec:
GET /spec.json - Process execution guide:
docs/processes.md - Browser REPL guide:
docs/repl.md
The server uses OpenAPI code generation. After modifying openapi.yaml:
make oapi-generatemake test