Use the CLI directly. Prefer JSON when available.
Preferred:
ccap --list-devices --jsonFallback text mode:
ccap --list-devicesPreferred:
ccap --device-info 0 --jsonIf the device opens successfully, expect capability data. If the device cannot be opened, expect a structured error or text error depending on mode.
Preferred:
ccap -i /path/to/video.mp4 --jsonUse this when no camera is required and the task is only about file inspection.
One frame:
ccap -d 0 -c 1 -o ./capturesBatch capture:
ccap -d 0 -c 10 -o ./captures- Do not assume camera permission is granted.
- Do not default to preview in headless environments.
- Do not assume Linux supports the same video playback features as macOS or Windows.
- Prefer JSON parsing over text scraping when
--jsonexists.