npx skills add ...
npx skills add nvidia/skills --skill vss-generate-video-report
Use this skill when producing a VSS analysis report — Mode A per-clip VLM, Mode B incident-range via video-analytics. Not for standalone video summarization, real-time alerts or ad-hoc Q&A.
npx skills add nvidia/skills --skill vss-generate-video-report
Generate a video analysis report by routing to one of two backends — never via POST /generate on the VSS agent.
| Mode | Backend |
|---|---|
| A. Video clip | /vss-manage-video-io-storage → clip URL → VLM chat/completions |
| B. Incident range | /vss-query-analytics → incident list → narrative report |
If the request is ambiguous (e.g. "report on <sensor>" with no time range and no incident wording), default to Mode A. Ask only if the user mentions both a sensor and a time range. See Examples below for the request phrasings that route to each mode.
/vss-deploy-profile if its probe fails.$VSS_PUBLIC_HOST:$VSS_PUBLIC_PORT one-liner (Browser-playable clip URL) before embedding it in the report.Output contract for evaluators:
# Video Analysis Report.# Incident Range Report (never # Incident Report or sensor-named variants).## Basic Information with the exact required rows from the template (Report Identifier, Range, Scope, Total Incidents, Confirmed / Rejected / Unverified).<sensor-id>" → Mode A<sensor> last hour" → Mode B<sensor> between <t1> and <t2>" → Mode BDo not use this skill when the request is one of the following:
/vss-ask-video./vss-search-archive./vss-query-analytics./vss-deploy-profile./vss-manage-alerts.Never route reports through VSS-agent POST /generate.
Mode A needs the VSS base profile (VST + VLM NIM). Mode B needs the VSS alerts profile (VA-MCP + Elasticsearch).
Probe:
If the probe fails, hand off to /vss-deploy-profile with -p base (Mode A) or -p alerts (Mode B). Always confirm the deploy with the user first.
VST returns clip URLs using the agent-internal ${HOST_IP}:30888 host:port.
Keep that original URL as VIDEO_URL for local / in-cluster VLM frame pulls.
Do not rewrite the VLM input URL just to make it browser-playable.
Only create BROWSER_CLIP_URL for URLs shown in the rendered report. The
deploy layer exports the browser-facing host:port as $VSS_PUBLIC_HOST /
$VSS_PUBLIC_PORT (and scheme as $VSS_PUBLIC_HTTP_PROTOCOL) in every
profile .env — Brev or bare-metal — so the report-link rewrite is:
If either required public host value is missing, omit the report-facing clip
link and call out that a browser-playable URL could not be produced; do not
block the local VLM analysis path. Apply the rewrite to every clip URL
surfaced in the rendered report (Mode A Step 4 Clip URL row; Mode B
per-incident clip sub-bullet). Leave the VLM video_url content block in Mode A
Step 3 on the original internal URL when the VLM is local / in-cluster.
If the VSS lvs profile is deployed — curl -sf --max-time 5 "http://${HOST_IP}:38111/v1/ready" returns HTTP 200 — run /vss-summarize-video to produce the summary, then paste its output into the report template in Step 4 and skip Steps 1–3 (the VLM-direct path). Run Steps 1–3 only when /v1/ready is non-200.
Hand off to /vss-manage-video-io-storage to:
List sensors and confirm the named <sensor-id> exists (upload first if not).
Fetch /storage/<streamId>/timelines for the recorded range when the user did not supply startTime / endTime.
Request a clip URL:
That gives a direct mp4 URL that the local / in-cluster VLM can pull frames from. Bind it to VIDEO_URL (used by the VLM in Step 3) and set RAW_URL="$VIDEO_URL" before applying the report-link rewrite to produce BROWSER_CLIP_URL for Step 4 — the user's browser cannot reach $VIDEO_URL directly.
Mode A requires the selected VLM endpoint to be able to fetch VIDEO_URL.
Local NIM/RT-VLM deployments normally can; remote endpoints generally cannot
fetch localhost, private HOST_IP, or VST-internal URLs. If the live
VLM_ENDPOINT is remote, surface that reachability requirement instead of
making a chat request that will fail after /v1/models succeeds.
The deploy may serve the VLM through either of two stacks. Both expose an OpenAI-compatible chat/completions API — pick whichever is live:
| Backend | Env vars | Typical host endpoint | Picked when |
|---|---|---|---|
| NIM Cosmos | VLM_BASE_URL, VLM_NAME, VLM_MODE, VLM_MODEL_TYPE | ${VLM_BASE_URL}/v1 (no trailing /v1 on the env var; the agent appends it) | VLM_MODEL_TYPE != rtvi and VLM_MODE ∈ {local, local_shared, remote} and VLM_BASE_URL is non-empty |
| RT-VLM Cosmos | RTVI_VLM_BASE_URL, RTVI_VLM_MODEL_TO_USE, VLM_MODEL_TYPE | ${RTVI_VLM_BASE_URL}/v1 — if unset, derive from ${HOST_IP} (http://${HOST_IP}:8018/v1 for alerts, http://${HOST_IP}:30082/v1 for base) | VLM_MODEL_TYPE = rtvi, or VLM_MODE=none, or VLM_BASE_URL empty; also the only path for warehouse |
Read the live values off the running agent container — do not guess:
Do not require RTVI_VLM_ENDPOINT from vss-agent env; several profiles do not inject it.
Selection rule:
Probe /v1/models before sending a chat request to confirm the chosen endpoint is alive and the model is loaded:
If the probe fails or the listed ids don't include ${VLM_MODEL}, fall back to the other backend (or surface the error — never silently pick a model that isn't on the server).
Use the OpenAI-compatible chat/completions endpoint with a video_url content block — the same payload shape and multimodal settings video_understanding builds in src/vss_agents/tools/video_understanding.py (_build_vlm_messages + the Cosmos base_vlm.bind(...) call).
The frame sampling and visual-token (pixel) budget must mirror the live video_understanding settings for the active profile. Send mm_processor_kwargs and media_io_kwargs so the direct call uses the same frame sampling and pixel budget as the in-agent video_understanding tool — omitting them lets the VLM apply its own defaults, so the output diverges from the agent path.
The kwargs block is backend-aware: on
nim_cosmos, Reason2 variants (nvidia/cosmos-reason2*) usemm_processor_kwargs.size{shortest_edge,longest_edge}and other NIM Cosmos variants (nvidia/cosmos*) usemm_processor_kwargs.videos_kwargs{min_pixels,max_pixels}; both also sendmedia_io_kwargs.video.num_frames. Onrtvlm, no Cosmos kwargs are sent.
If the VLM returns a <think>…</think> block (Cosmos Reason reasoning mode), keep only the text after </think> as the report body.
Copy assets/video-analysis-report.md, fill every placeholder, and return the rendered markdown to the user. Keep the source asset unchanged. Before rendering, verify BROWSER_CLIP_URL is set and non-empty, then replace <BROWSER_CLIP_URL> with that exact value in the Clip URL row. Never leave the placeholder in the output, never include template instructions in a filled cell, and never use the raw HOST_IP:30888 URL.
start_time / end_time must be ISO 8601 UTC (YYYY-MM-DDTHH:MM:SS.sssZ). Resolve relative phrases ("last hour", "today") against the current host clock.source + source_type=sensor. Otherwise leave both unset for an all-sensors query./vss-query-analyticsHand off to /vss-query-analytics (initialize → tools/call) with:
Read-only boundary (mandatory):
For each incident keep: id, sensorId, timestamp, end, category, place.name, info.verdict, info.reasoning, objectIds, and the clip URL (commonly info.clip_url, clip_url, or whichever clip-pointer field the response carries). Apply the $VSS_PUBLIC_HOST:$VSS_PUBLIC_PORT rewrite (see Browser-playable clip URL above) to every clip URL before pasting it into the report — the raw value is a HOST_IP:30888 URL the user's browser cannot reach.
Copy assets/incident-range-report.md, then group by sensor (or by category if no sensor scope), tally verdicts, and list each incident with timestamp / category / verdict / reasoning. Keep the source asset unchanged. Every incident clip value must be a rewritten browser-playable URL; omit the clip line when the incident carries no clip URL. Never include template instructions in a filled cell.
If get_incidents returns zero results, STOP and return exactly a one-line empty-range statement naming the requested range and scope. Do not render the full Incident Range template, do not invent incidents, do not seed test data, and do not fall back to Mode A.
curl, VLM call, or /vss-query-analytics request fails, stop the workflow and report the failing endpoint, HTTP status or command error, and the next useful recovery step. Do not fabricate a report from partial or missing data.info.reasoning, objectIds, clip URL) as omissions in the report, but treat missing id, timestamp, or category as a data-quality error that should be reported./vss-manage-video-io-storage — sensor list, timelines, and clip URL for Mode A Step 1./vss-query-analytics — incident retrieval (and verdict / reasoning enrichment) for Mode B Step 2./vss-ask-video — ad-hoc VLM Q&A on a single clip (not a structured report)./vss-summarize-video — used by Mode A to produce the summary body when the lvs profile is deployed; the report template (Step 4) is still filled here.: "${VSS_PUBLIC_HOST:?Set VSS_PUBLIC_HOST before rewriting clip URLs}"
: "${VSS_PUBLIC_PORT:?Set VSS_PUBLIC_PORT before rewriting clip URLs}"
VSS_PUBLIC_HTTP_PROTOCOL="${VSS_PUBLIC_HTTP_PROTOCOL:-http}"
BROWSER_CLIP_URL=$(echo "$RAW_URL" | sed -E "s|^https?://[^/]+|${VSS_PUBLIC_HTTP_PROTOCOL}://${VSS_PUBLIC_HOST}:${VSS_PUBLIC_PORT}|")