> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stmlink.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# GB28181 摄像头

> 把国标监控摄像头、NVR 接进会议：在管理后台查平台信息、登记设备和通道，在摄像头（以海康为例）上配置平台接入，再把通道邀请进会，附两端配置截图和字段对照

国标摄像头接入分三步：**摄像头注册到设备网关 → 在后台登记设备和通道 → 把通道邀请进会**。
摄像头只往会里送画面（单向），一台 NVR 下的多个通道可以各自作为一路画面进会。

下面以海康摄像头为例。所有示例值前后对应，照着替换成你自己的即可。

***

## 1. 查看平台信息

打开管理后台 **设备管理** → **GB28181** → **平台信息**：

![平台信息](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/admin-gb-platform-info.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=1818603787a5d8c872881d9fd6bdd786)

这四项要原样填到摄像头上，记下来：

| 平台信息 | 示例 | 含义 |
| - | - | - |
| SIP 服务器 ID | `37070000082000000001` | 设备网关的国标编号 |
| SIP 服务器（域） | `3707000008` | 国标域 |
| SIP 服务器地址 | `192.168.10.5` | 设备网关地址，摄像头要能访问到 |
| SIP 服务器端口 | `5070` | 国标信令端口 |

有多个设备网关时，每个网关各列一组，摄像头注册到哪个网关就用哪组。

***

## 2. 在后台登记设备

**GB28181** 标签下点 **添加设备**：

![添加 GB28181 设备](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/admin-gb-add.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=b81b3277f8776bd86483e2faa5c90844)

| 字段 | 填什么 |
| - | - |
| 设备名称 | 自己起，比如「东门球机」 |
| 设备 id | 摄像头的国标编号（20 位数字）。没有现成的可以点 **自动生成**，再把生成的编号填到摄像头上 |
| 设备密码 | 摄像头注册时用的密码，两边要一致 |
| 设备网关 | 摄像头注册到哪个网关 |

***

## 3. 在摄像头上配置平台接入

登录摄像头的 Web 管理页面，海康在 **配置 → 网络 → 高级配置 → 平台接入**。平台接入方式选 **28181**，启用后填：

![海康摄像头平台接入配置](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/gb-hik-platform.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=716afecf304586c67943b5252dfa3e10)

| 摄像头上的字段 | 填什么 | 对应 |
| - | - | - |
| 协议版本 | GB/T28181-2016 | — |
| SIP 服务器 ID | `37070000082000000001` | 第 1 步「平台信息」 |
| SIP 服务器域 | `3707000008` | 第 1 步「平台信息」 |
| SIP 服务器地址 | `192.168.10.5` | 第 1 步「平台信息」 |
| SIP 服务器端口 | `5070` | 第 1 步「平台信息」 |
| SIP 用户名、SIP 用户认证 ID | `37070000082008000001` | 第 2 步的「设备 id」 |
| 密码 | 与第 2 步的「设备密码」一致 | 第 2 步 |
| 心跳周期 | **30 秒** | 太长会被判定掉线 |

保存后，摄像头上的 **注册状态** 变成「在线」，后台设备列表里的状态也会变成 **在线**：

![GB28181 设备列表](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/admin-gb-list.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=247d47fa653b3a34b4b6b78a8dc430ac)

> [!WARNING]
>
> **心跳周期建议 30 秒**。设备默认值往往更长，平台等不到心跳会把设备判为离线，邀请时就会失败。

***

## 4. 登记通道

一台设备下可以有多个视频通道（NVR 的每路摄像头、球机的每个码流），**进会的单位是通道**。

先在摄像头上找到通道编码：同一页往下的 **编码 ID → 视频通道编码 ID**，记下通道的编码：

![海康摄像头视频通道编码 ID](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/gb-hik-channel.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=8e9e590119ac6b5861d940bac235a4ca)

回到后台，点设备左侧的 **+** 展开，点 **添加通道**：

![添加通道](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/admin-gb-channel-add.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=42cfdd5fa300ac5f317ba4eb7fb9b8f8)

| 字段 | 填什么 |
| - | - |
| 通道名称 | 会中显示的名字，比如「东门球机-通道1」 |
| 通道 id | 摄像头上的「视频通道编码 ID」 |

添加后的效果：

![设备下的通道列表](https://mintcdn.com/freewind/EF59QLb6N-9opFfC/zh/product/device-access/images/admin-gb-channel-list.png?fit=max\&auto=format\&n=EF59QLb6N-9opFfC\&q=85\&s=253423c351c9aae3f3af0cc7563e9b26)

***

## 5. 邀请进会

国标摄像头不能自己呼入，只能由平台邀请：

* **管理后台**：会议详情 → **邀请** → **邀请设备** → **国标GB28181**
* **会议客户端**：主持人 **邀请** → **邀请设备**
* **业务系统**：调用[邀请设备入会](https://docs.stmlink.com/zh/rtc/server-api/agent.md#邀请设备入会)，每个通道是一条邀请

进会后，这路画面就是会里的一名成员，名字是通道名称。

### 云台与预置位

转动镜头、变焦、调用预置位目前**通过服务端接口操作**（管理后台暂未提供按钮）：
[控制国标设备的云台](https://docs.stmlink.com/zh/rtc/server-api/agent.md#控制国标设备的云台（方向与变焦）)、[操作国标设备的预置位](https://docs.stmlink.com/zh/rtc/server-api/agent.md#操作国标设备的预置位)。

***

## 字段对照速查

```text theme={null}
摄像头                       管理后台
─────────────────────────   ─────────────────────────
SIP 服务器 ID / 域 / 地址 / 端口  ←  平台信息
SIP 用户名 / 认证 ID          =   设备 id
密码                         =   设备密码
视频通道编码 ID               =   通道 id
```

接不上？见[常见问题](https://docs.stmlink.com/zh/product/device-access/faq.md#国标摄像头接不上)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.