视频分析

人工智能 社区

技能解读

当前原文的自动摘译,尚未人工审校。

部署前提条件

此技能从 VSS 警报配置文件(verification 或 real-time 模式)启动的 Elasticsearch/VA-MCP 堆栈中读取。在进行任何查询之前: 探测 VA-MCP 端点:如果探测失败,请询问用户: “VSS alerts 配置文件未在 $HOST_IP 上运行(VA-MCP 无法访问)。我应该部署哪种模式 — verification (CV) 或 real-time (VLM)?” 回答 → 将其移交给 /deploy 技能-p alerts -m <mode>。成功后返回这里。

必需:两步模式(准确复制此内容)

每个查询都需要两个按顺序运行的 shell 命令: 会话 ID 来自响应头mcp-session-id,而不是正文。跳过第 1 步始终会导致Bad Request: Missing session ID。

工具参考

将步骤 2 中的-d 有效负载替换为以下任意内容。

视频分析发生事件

参数 · 类型 · 描述 source · 字符串 · 传感器 ID 或地点名称(可选) source_type · 字符串 · sensor 或 place start_time · 字符串 · ISO 8601: YYYY-MM-DDTHH:MM:SS.sssZ end_time · 字符串 · ISO 8601

视频分析

analysis_type: max_min_incidents, average_speed, avg_num_people, avg_num_vehicles

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
人工智能
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
94 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@NVIDIA-AI-Blueprints · Apache-2.0
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 命令执行
网络行为
允许外网请求
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Video Analytics (VA-MCP)

Queries incidents, alerts, and metrics stored in Elasticsearch via MCP JSON-RPC at **port 9901**.

> **ALWAYS run the commands below yourself and relay results to the user. Do NOT guess or describe — actually execute and report back.**

---

## Deployment prerequisite

This skill reads from the Elasticsearch/VA-MCP stack brought up by the VSS **alerts** profile (either `verification` or `real-time` mode). Before any query:

1. Probe the VA-MCP endpoint:
   ```bash
   curl -sf --max-time 5 "http://${HOST_IP}:9901/mcp" >/dev/null 2>&1 || \
     curl -sf --max-time 5 "http://${HOST_IP}:9901/" >/dev/null
   ```

2. **If the probe fails**, ask the user:
   > *"The VSS `alerts` profile isn't running on `$HOST_IP` (VA-MCP unreachable). Which mode should I deploy — `verification` (CV) or `real-time` (VLM)?"*

   - Answer → hand off to the `/deploy` skill with `-p alerts -m <mode>`. Return here once it succeeds.
   - If the user declines → stop. No incidents/alerts/metrics to query without the alerts stack up.

   (If your caller has granted explicit pre-authorization to deploy
   autonomously — e.g. the request says "pre-authorized to deploy
   prerequisites", or you are running in a non-interactive evaluation
   harness with that permission — skip the confirmation and invoke
   `/deploy` directly. Default the mode to `verification` unless the
   request specifies otherwise.)

3. If the probe passes, proceed.

---

## REQUIRED: Two-Step Pattern (copy this exactly)

**Every query requires two shell commands run in sequence:**

```bash
# Step 1: initialize — get session ID from response HEADER
SESSION_ID=$(curl -si -X POST http://localhost:9901/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli","version":"1.0"}},"id":0}' \
  | grep -i "mcp-session-id" | awk '{print $2}' | tr -d '\r')

# Step 2: call the tool using the session ID in the header
curl -s -X POST http://localhost:9901/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}' \
  | grep '^data:' | sed 's/^data: //' | jq -r '.result.content[0].text'
```

> The session ID comes from the **response header** `mcp-session-id`, not the body.
> Skipping Step 1 always results in `Bad Request: Missing session ID`.

---

## Tool Reference

Replace the `-d` payload in Step 2 with any of the following.

### video_analytics__get_incidents

| Parameter | Type | Description |
|---|---|---|
| `source` | string | Sensor ID or place name (optional) |
| `source_type` | string | `sensor` or `place` |
| `start_time` | string | ISO 8601: `YYYY-MM-DDTHH:MM:SS.sssZ` |
| `end_time` | string | ISO 8601 |
| `max_count` | int | Max results (default: 10) |
| `includes` | list | Extra fields: `objectIds`, `info` |
| `vlm_verdict` | string | `confirmed`, `rejected`, or `unverified` |

```bash
# Recent incidents (all sensors)
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'

# For a specific sensor
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"source":"<sensor-id>","source_type":"sensor","max_count":20}},"id":1}'

# Confirmed (VLM-verified) only
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"vlm_verdict":"confirmed","max_count":10}},"id":1}'
```

### video_analytics__get_incident

```bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incident","arguments":{"id":"<incident-id>","includes":["objectIds","info"]}},"id":1}'
```

### video_analytics__get_sensor_ids

```bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_sensor_ids","arguments":{}},"id":1}'
```

### video_analytics__get_places

```bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_places","arguments":{}},"id":1}'
```

### video_analytics__get_fov_histogram

```bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_fov_histogram","arguments":{"source":"<sensor-id>","source_type":"sensor","start_time":"<ISO>","end_time":"<ISO>","object_type":"Person","bucket_count":10}},"id":1}'
```

### video_analytics__analyze

`analysis_type`: `max_min_incidents`, `average_speed`, `avg_num_people`, `avg_num_vehicles`

```bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__analyze","arguments":{"source":"<sensor-id>","source_type":"sensor","start_time":"<ISO>","end_time":"<ISO>","analysis_type":"avg_num_people"}},"id":1}'
```

### vst_sensor_list

```bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"vst_sensor_list","arguments":{}},"id":1}'
```

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。