onvif_scan — WS-Discovery + ONVIF + RTSP scanner (and corpus grower)
onvif_scan lives in crates/patinas-adapters-rtsp and is designed to answer two questions quickly:
- Why didn’t we find this camera / stream? (actionable per-host results)
- How do we grow interoperability coverage safely? (golden corpus growth)
Quick start
From the Patinas workspace root (.../patinas/patinas):
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- --help
Output modes
All subcommands support:
--output pretty(human-oriented, default)--output summary(one-line-ish per host)--output jsonl(machine ingest / CI artifacts)
Common workflows
1) Unified scan (recommended default)
WS-Discovery first, then direct ONVIF probing on discovered/seeded hosts:
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- scan --lan --output summary
Seed with explicit targets (CIDRs or IPs) to force direct probing even if WS-Discovery is quiet:
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- scan --lan --targets "192.0.2.0/24" --output jsonl
2) WS-Discovery only
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- discover --lan --timeout-ms 2500
Link-local discovery requires an interface name:
# Find interface names on Linux:
ip -br link
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- discover --link-local --iface enp0s31f6
3) Direct ONVIF probe (no WS-Discovery)
Use this when you know the target(s) but discovery is blocked, vendor-broken, or on a nonstandard port.
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- probe \
--targets "192.0.2.0/24" \
--vendor tapo \
--username "<user>" --password "<pass>" --wsse \
--stream-uri \
--output pretty
TLS notes:
--onvif-schemes httpswill attempt HTTPS.--tls-insecurewill accept invalid certs/hostnames (lab/dev only).
4) RTSP DESCRIBE (prints SDP)
Digest auth is supported.
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- rtsp-describe \
--url "rtsp://192.0.2.50:554/Streaming/Channels/1" \
--username "<user>" --password "<pass>"
5) Scan for non-ONVIF RTSP endpoints
This is for devices that expose RTSP but don’t speak ONVIF (or where ONVIF is disabled).
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- rtsp-scan \
--targets "192.0.2.0/24" \
--options-first \
--output summary
IPv6 link-local targets need an interface (or allow auto-pick):
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- rtsp-scan \
--targets "fe80::/10" \
--iface enp0s31f6 \
--output summary
6) Grow the golden corpus (recommended for “complete ONVIF coverage”)
See docs/testing/ONVIF_CORPUS.md for the full workflow and where fixtures live.
cargo run -p patinas-adapters-rtsp --bin onvif_scan -- grow-corpus \
--targets "192.0.2.50" \
--username "<user>" --password "<pass>" --wsse \
--case-prefix "desk" \
--output pretty
Full CLI (help excerpt)
This is the current command surface (run --help for the definitive version):
Commands:
discover WS-Discovery discovery (UDP 3702)
probe Direct ONVIF probe (no WS-Discovery)
rtsp-describe RTSP DESCRIBE and print SDP (supports Digest auth)
grow-corpus Get stream URIs then DESCRIBE + run onvif_fixturegen to grow golden corpus
rtsp-scan Scan for non-ONVIF RTSP endpoints (common ports + paths)
scan Unified scan: WS-Discovery first, then direct ONVIF on discovered/seeded hosts