desktop

Record the desktop to an MP4 file.

Starts recording the running desktop and answers once frames are being written. One recording at a time. The recorder uses one encoder thread at low priority, at most 30 fps; the file never exceeds maxMiB and recording stops while the sandbox's disk still has 256 MiB free. The file is on the sandbox's own disk and counts toward it; a sandbox keeps at most 8192 MiB of recordings. It is a fragmented MP4, so a recording cut short still plays. The first recording in a sandbox without ffmpeg installs it (up to a minute). Needs exec. 507 insufficient_storage when there is no room.

post/v1/sandboxes/{id}/desktop/recordings

Request

  • Base URL: https://api.withruntime.com
  • URL: https://api.withruntime.com/v1/sandboxes/{id}/desktop/recordings
  • Auth: HTTP bearer

Path parameters

idstring required

Resource identifier (UUID).

Headers

Idempotency-Keystring

Replaying the same key with the same request within 24 hours returns the first result and never repeats the effect. A refusal is not kept: a request refused before it ran (no_capacity, busy, a limit) runs afresh when sent again with its key. The SDKs send one automatically; the server makes one when absent and returns it in the idempotency-key response header.

Request body

fpsinteger

Frames a second. Default 10.

maxSecondsinteger

Stop after this much video. Default 1800.

maxMiBinteger

The file never grows past this. Default 512.

crfinteger

Quality: 18 is sharp and large, 45 small. Default 30.

Response

Success

idstring required
state'starting' | 'installing' | 'recording' | 'finished' | 'failed' required
pathstring required

The MP4 file in the sandbox.

bytesinteger required
secondsnumber
reasonstring nullable

Why it ended: stopped, max-seconds, max-bytes, disk-low (the disk reached its 256 MiB reserve), desktop-gone, error.

processIdstring nullable
startedAtinteger nullable

Changes

No recorded changes to this operation across all 1 revision of this API.