CamSnap
Capture frames or clips from RTSP/ONVIF cameras. Supports snapshots, video clips, and motion detection.
CamSnap is a Go-based CLI for capturing snapshots, recording short video clips, and running motion detection against RTSP/ONVIF IP cameras. Built by Peter Steinberger (steipete), it wraps ffmpeg with a clean, camera-aware interface that handles the gnarly details of RTSP stream negotiation.
The tool supports a config-driven approach: define your cameras once in `~/.config/camsnap/config.yaml` with per-camera defaults for transport protocol, stream selection, and audio handling. Then grab frames or clips with simple commands like `camsnap snap kitchen`. It auto-discovers cameras on your network via ONVIF, supports both TCP and UDP RTSP transport, and includes a built-in diagnostic tool (`camsnap doctor`) for troubleshooting connectivity.
Motion detection is where CamSnap really shines for automation. The `watch` command continuously monitors a camera feed and triggers custom actions (shell commands) when motion exceeds a threshold. Combined with OpenClaw, you can build intelligent surveillance: detect motion → snap a frame → analyze with vision AI → notify via Telegram.
CamSnap works with a wide range of cameras: TP-Link Tapo, UniFi Protect (with tokenized RTSP paths), Reolink, Hikvision, and any standard RTSP camera. The UniFi Protect support is notable — it handles the token-based RTSP URLs that trip up simpler tools.
Best suited for: smart home enthusiasts with IP cameras, OpenClaw users wanting AI-powered surveillance, anyone who needs scriptable camera access without a full NVR.
Tags: camera, rtsp, security, surveillance, smart-home
Category: Smart Home
Use Cases
- Quick security check: snap a frame from any camera on demand
- Motion-triggered alerts: detect movement → analyze with AI → notify
- Periodic timelapse capture via cron automation
- Clip recording for incident documentation
- Camera health monitoring with doctor diagnostics
- Pet/baby monitoring with motion watch and notifications
Tips
- Run `camsnap doctor --probe` first to diagnose camera connectivity issues
- Use `camsnap discover --info` to auto-find cameras on your network via ONVIF
- Set per-camera defaults in config.yaml so you don't need flags every time
- Combine motion detection with OpenClaw's image analysis for smart alerts
- Use `--no-audio` for clips when you only need video — smaller files, faster capture
- For Tapo cameras: enable third-party RTSP, set per-camera account, disable Privacy Mode
- Pair with cron for periodic snapshots as a poor man's timelapse
Known Issues & Gotchas
- Requires ffmpeg on PATH — Homebrew install handles this automatically
- TP-Link Tapo cameras often need UDP transport + stream2 + gortsplib client
- Tapo cameras may require disabling Tapo Care/SD recording to free RTSP streams
- UniFi Protect requires enabling RTSP in the Protect UI and copying the token path
- Longer timeouts (--timeout 20s) may be needed for Protect streams to deliver the first keyframe
- Motion detection threshold needs tuning per camera — too low = false positives, too high = misses
- Some cameras limit concurrent RTSP connections — close other viewers before snapping
Alternatives
- ffmpeg (direct)
- Frigate NVR
- Scrypted
- ONVIF Device Manager
Community Feedback
CLI to capture snapshots, short clips, and run motion detection against RTSP/ONVIF cameras. Supports per-camera defaults for RTSP transport, stream, client, and audio handling.
— GitHub
CamSnap enables AI agents to capture frames or clips from RTSP/ONVIF cameras with support for snapshots, video clips, and motion detection.
— OpenClaw Skills Registry
Configuration Examples
Add a Tapo camera
camsnap add --name kitchen --host 192.168.0.175 --user tapo --pass 'secret' \
--rtsp-transport udp --stream stream2 --rtsp-client gortsplibAdd a UniFi Protect camera
camsnap add --name livingroom --host 192.168.1.1 --port 7447 \
--protocol rtsp --path Bfy47SNWz9n2WRrwMotion detection with action trigger
camsnap watch kitchen --threshold 0.2 --cooldown 5s \
--json --action 'touch /tmp/motion-$(date +%s)'
# Environment vars: CAMSNAP_CAMERA, CAMSNAP_SCORE, CAMSNAP_TIMEInstallation
brew install steipete/tap/camsnapHomepage: https://camsnap.ai
Source: bundled