> ## 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 cameras

> Bring GB28181 cameras and NVRs into meetings: look up platform info and register the device and channels in the admin console, configure platform access on the camera (Hikvision example), and invite channels into the meeting, with screenshots and a field mapping.

GB28181 camera integration takes three steps: **the camera registers to the device gateway → register the device and channels in the console → invite channels into the meeting**.
Cameras only send video into the meeting (one-way), and multiple channels under one NVR can each enter as a separate video.

The example below uses a Hikvision camera. All example values correspond across steps; just replace them with your own.

***

## 1. View the platform info

Open the admin console **Device management** → **GB28181** → **Platform info**:

![Platform info](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)

These four values must be entered on the camera exactly as shown, so note them down:

| Platform info | Example | Meaning |
| - | - | - |
| SIP server ID | `37070000082000000001` | The device gateway's GB28181 ID |
| SIP server (domain) | `3707000008` | GB28181 domain |
| SIP server address | `192.168.10.5` | Device gateway address; the camera must be able to reach it |
| SIP server port | `5070` | GB28181 signaling port |

With multiple device gateways, each gateway has its own set; use the set for the gateway the camera registers to.

***

## 2. Register the device in the console

On the **GB28181** tab, click **Add device**:

![Add a GB28181 device](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)

| Field | What to enter |
| - | - |
| Device name | Any name you like, for example "East gate PTZ camera" |
| Device id | The camera's GB28181 ID (20 digits). If it doesn't have one, click **Auto-generate** and enter the generated ID on the camera |
| Device password | The password the camera uses to register; must match on both sides |
| Device gateway | Which gateway the camera registers to |

***

## 3. Configure platform access on the camera

Log in to the camera's web management page. On Hikvision it's under **Configuration → Network → Advanced Settings → Platform Access**. Set the platform access mode to **28181**, enable it, and enter:

![Hikvision camera platform access settings](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)

| Field on the camera | What to enter | Source |
| - | - | - |
| Protocol version | GB/T28181-2016 | — |
| SIP server ID | `37070000082000000001` | Step 1 "Platform info" |
| SIP server domain | `3707000008` | Step 1 "Platform info" |
| SIP server address | `192.168.10.5` | Step 1 "Platform info" |
| SIP server port | `5070` | Step 1 "Platform info" |
| SIP username, SIP user authentication ID | `37070000082008000001` | "Device id" from step 2 |
| Password | Same as "Device password" in step 2 | Step 2 |
| Heartbeat interval | **30 seconds** | Too long and the device is judged offline |

After saving, the camera's **Registration status** changes to "Online", and the status in the console's device list also changes to **Online**:

![GB28181 device list](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]
>
> **We recommend a 30-second heartbeat interval.** Device defaults are often longer; if the platform doesn't receive a heartbeat in time, it marks the device offline and invitations fail.

***

## 4. Register channels

A device can have multiple video channels (each camera on an NVR, each stream of a PTZ camera), and **the unit that enters the meeting is the GB28181 channel**.

First find the channel encoding on the camera: further down the same page under **Encoding ID → Video Channel Encoding ID**, note the channel's encoding:

![Hikvision camera video channel encoding 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)

Back in the console, click **+** to the left of the device to expand it, then click **Add channel**:

![Add a channel](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)

| Field | What to enter |
| - | - |
| Channel name | The name shown in the meeting, for example "East gate PTZ camera - channel 1" |
| Channel id | The camera's "Video Channel Encoding ID" |

The result after adding:

![Channel list under the device](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. Invite into the meeting

GB28181 cameras can't dial in by themselves; only the platform can invite them:

* **Admin console**: meeting details → **Invite** → **Invite device** → **GB28181**
* **Meeting client**: the host clicks **Invite** → **Invite device**
* **Business system**: call [Invite devices to the channel](https://docs.stmlink.com/en/rtc/server-api/agent.md#invite-devices-to-the-channel); each GB28181 channel is one invitation

Once in the meeting, the video is a member of the meeting, named by the channel name.

### PTZ and preset positions

Panning, zooming, and recalling preset positions are currently **done through the server API** (the admin console doesn't have buttons for them yet):
[Control GB28181 device PTZ](https://docs.stmlink.com/en/rtc/server-api/agent.md#control-gb28181-device-ptz-direction-and-zoom) and [Manage GB28181 device preset positions](https://docs.stmlink.com/en/rtc/server-api/agent.md#manage-gb28181-device-preset-positions).

***

## Field mapping quick reference

```text theme={null}
Camera                              Admin console
─────────────────────────────────   ─────────────────────────
SIP server ID / domain / address / port  ←  Platform info
SIP username / authentication ID     =   Device id
Password                             =   Device password
Video Channel Encoding ID            =   Channel id
```

Can't connect? See the [FAQ](https://docs.stmlink.com/en/product/device-access/faq.md#gb28181-camera-wont-connect).


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