Source-grounded rewrite of 529 published docs pages with per-unit information-loss verification: 1,713 factual corrections cited to src/**, generated surfaces regenerated, frontmatter titles preserved for i18n, release notes pages untouched. All docs gates green. Closes #100141
6.3 KiB
summary, read_when, title
| summary | read_when | title | ||
|---|---|---|---|---|
| Camera capture (iOS/Android nodes + macOS app) for agent use: photos (jpg) and short video clips (mp4) |
|
Camera capture |
OpenClaw supports camera capture for agent workflows on paired iOS, Android, and macOS nodes: capture a photo (jpg) or a short video clip (mp4, with optional audio) via Gateway node.invoke.
All camera access is gated behind a user-controlled setting per platform.
iOS node
iOS user setting
- iOS Settings tab → Camera → Allow Camera (
camera.enabled).- Default: on (missing key is treated as enabled).
- When off:
camera.*commands returnCAMERA_DISABLED.
iOS commands (via Gateway node.invoke)
-
camera.list- Response payload:
devices— array of{ id, name, position, deviceType }.
- Response payload:
-
camera.snap- Params:
facing:front|back(default:front)maxWidth: number (optional; default1600)quality:0..1(optional; default0.9, clamped to[0.05, 1.0])format: currentlyjpgdelayMs: number (optional; default0, internally capped at10000)deviceId: string (optional; fromcamera.list)
- Response payload:
format: "jpg",base64,width,height. - Payload guard: photos are recompressed to keep the base64-encoded payload under 5MB.
- Params:
-
camera.clip- Params:
facing:front|back(default:front)durationMs: number (default3000, clamped to[250, 60000])includeAudio: boolean (defaulttrue)format: currentlymp4deviceId: string (optional; fromcamera.list)
- Response payload:
format: "mp4",base64,durationMs,hasAudio.
- Params:
iOS foreground requirement
Like canvas.*, the iOS node only allows camera.* commands in the foreground. Background invocations return NODE_BACKGROUND_UNAVAILABLE.
CLI helper
The easiest way to get media files is via the CLI helper, which writes decoded media to a temp file and prints the saved path.
openclaw nodes camera snap --node <id> # default: both front + back (2 MEDIA lines)
openclaw nodes camera snap --node <id> --facing front
openclaw nodes camera clip --node <id> --duration 3000
openclaw nodes camera clip --node <id> --no-audio
nodes camera snap defaults to --facing both, capturing both front and back to give the agent both views; pass --device-id with a single explicit facing (both is rejected when --device-id is set). Output files are temporary (in the OS temp directory) unless you build your own wrapper.
Android node
Android user setting
- Android Settings sheet → Camera → Allow Camera (
camera.enabled).- Fresh installs default to off. Existing installs that predate this setting are migrated to on so upgrades do not silently lose previously working camera access.
- When off:
camera.*commands returnCAMERA_DISABLED: enable Camera in Settings.
Permissions
CAMERAis required for bothcamera.snapandcamera.clip; missing/denied permission returnsCAMERA_PERMISSION_REQUIRED.RECORD_AUDIOis required forcamera.clipwhenincludeAudioistrue; missing/denied permission returnsMIC_PERMISSION_REQUIRED.
The app prompts for runtime permissions when possible.
Android foreground requirement
Like canvas.*, the Android node only allows camera.* commands in the foreground. Background invocations return NODE_BACKGROUND_UNAVAILABLE: command requires foreground.
Android commands (via Gateway node.invoke)
-
camera.list- Response payload:
devices— array of{ id, name, position, deviceType }.
- Response payload:
-
camera.snap- Params:
facing(front|back, defaultfront),quality(default0.95, clamped to[0.1, 1.0]),maxWidth(default1600),deviceId(optional; unknown id fails withINVALID_REQUEST). - Response payload:
format: "jpg",base64,width,height. - Payload guard: recompressed to keep base64 under 5MB (same budget as iOS).
- Params:
-
camera.clip- Params:
facing(defaultfront),durationMs(default3000, clamped to[200, 60000]),includeAudio(defaulttrue),deviceId(optional). - Response payload:
format: "mp4",base64,durationMs,hasAudio. - Payload guard: raw MP4 is capped at 18MB before base64 encoding; oversize clips fail with
PAYLOAD_TOO_LARGE(reducedurationMsand retry).
- Params:
macOS app
macOS user setting
The macOS companion app exposes a checkbox:
- Settings → General → Allow Camera (
openclaw.cameraEnabled).- Default: off.
- When off: camera requests return
CAMERA_DISABLED: enable Camera in Settings.
CLI helper (node invoke)
Use the main openclaw CLI to invoke camera commands on the macOS node.
openclaw nodes camera list --node <id> # list camera ids
openclaw nodes camera snap --node <id> # prints saved path
openclaw nodes camera snap --node <id> --max-width 1280
openclaw nodes camera snap --node <id> --delay-ms 2000
openclaw nodes camera snap --node <id> --device-id <id>
openclaw nodes camera clip --node <id> --duration 10s # prints saved path
openclaw nodes camera clip --node <id> --duration-ms 3000 # prints saved path (legacy flag)
openclaw nodes camera clip --node <id> --device-id <id>
openclaw nodes camera clip --node <id> --no-audio
openclaw nodes camera snapdefaults tomaxWidth=1600unless overridden.camera.snapwaitsdelayMs(default 2000ms, clamped to[0, 10000]) after warm-up/exposure settle before capturing.- Photo payloads are recompressed to keep base64 under 5MB.
Safety + practical limits
- Camera and microphone access trigger the usual OS permission prompts (and require usage strings in
Info.plist). - Video clips are capped at 60s to avoid oversized node payloads (base64 overhead plus message limits).
macOS screen video (OS-level)
For screen video (not camera), use the macOS companion:
openclaw nodes screen record --node <id> --duration 10s --fps 15 # prints saved path
Requires macOS Screen Recording permission (TCC).