analyze_stream
Probes an RTSP stream or local file to retrieve width, height, and fps, and generates a candidate test case list. Optionally accepts per-frame annotations to include discovered labels.
Instructions
v1.1.0 — Edge AI version of analyze_url / analyze_screen. Probes an RTSP stream (or a file path destined for local mediamtx) and returns basic geometry (width / height / fps) plus a candidate_tcs list. When an annotations sidecar (JSON: per-frame expected detections) is supplied, candidate_tcs gets one entry per discovered label PLUS four runner-standard entries (throughput, latency SLA, reconnect, empty-frame). Strings only — same schema parity as analyze_url's candidate_tcs.
Vendor-host blacklist (default-on): refuses RTSP URLs at known surveillance / IoT camera vendor domains (Dahua / Hikvision / etc.) to keep accidental probing of public camera feeds off the default path. Set QA_EDGE_ALLOW_VENDOR_HOSTS=true to opt out for own-camera testing.
Requires the [edge] extras (pip install "mk-qa-master[edge]") — opencv-python is the probe driver. Tool returns {error: missing_extras, hint} when the extras aren't installed.
Returns on success: {url, width, height, fps, labels, candidate_tcs}. Returns on rejection: {error: bad_request | forbidden_vendor_host | missing_extras | stream_unreachable, hint, ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rtsp_url | Yes | Required. The stream to probe. Either an `rtsp://...` URL or a file path that the EdgeInferenceRunner will serve via mediamtx + ffmpeg at setup time. | |
| annotations_path | No | Optional. JSON sidecar with per-frame expected detections (format: {fps, frames: {frame_idx: [{label, bbox}, ...]}}). When supplied, candidate_tcs lists one entry per discovered label. Missing / malformed files are non-fatal — the tool falls back to label-free candidates. |