Ocyss/srs-auth / .agents/skills/internal-docs-for-srs
internal-docs-for-srs
FlaggedRoute SRS and Oryx tasks to the smallest relevant set of trusted project documentation and maintain the project documentation bundled with this skill. Use whenever support or development work requires locating, choosing, reading, creating, updating, or reviewing SRS documentation, or whenever Oryx work requires project documentation for deployment, streaming, authentication, recording to local or S3-compatible storage, restreaming, virtual live, camera, transcoding, HTTPS, APIs, callbacks, AI features, or development. Includes the C++ media server documentation, Oryx project documentation, website pages, changelog, executable API examples, and next-generation Go server and performance documentation.
references/cpp-docs/doc/gb28181.md
View on GitHub---
title: GB28181
sidebar_label: GB28181
hide_title: false
hide_table_of_contents: false
---
# GB28181
SRS uses an external SIP server, such as
[srs-sip](https://github.com/ossrs/srs-sip), for GB28181 signaling and receives
the media stream as RTP/PS over TCP. The external SIP server creates the SRS
media session through the HTTP API, then instructs the device to publish to the
TCP port returned by SRS.
Build SRS with GB28181 enabled:
```bash
./configure --gb28181=on && make
```
Configure the GB28181 stream caster:
```conf
stream_caster {
enabled on;
caster gb28181;
output rtmp://127.0.0.1/live/[stream];
listen 9000;
# Maximum time, in seconds, that an API-created session waits for its
# media TCP connection. Fractional values such as 0.5 are supported.
# Default: 10
media_connect_timeout 10;
}
http_api {
enabled on;
listen 1985;
}
```
## External SIP API
After completing the SIP negotiation, create the media session with the stream
ID and decimal RTP SSRC selected by the external SIP server:
```bash
curl -X POST http://127.0.0.1:1985/gb/v1/publish/ \
-H 'Content-Type: application/json' \
-d '{"id":"34020000001320000001","ssrc":"47190001"}'
```
SRS returns the media endpoint:
```json
{"code":0,"port":9000,"is_tcp":true}
```
The device or external SIP service should then connect to the returned port and
publish RFC4571-framed RTP/PS over TCP using the same SSRC.
## Session Lifecycle
The stream ID and SSRC uniquely reserve a GB28181 session. Creating another
session with either value while it remains reserved returns `StreamBusy`.
`media_connect_timeout` controls how long SRS keeps a session that was created
through `/gb/v1/publish/` but never receives its media TCP connection. It is
measured in seconds, supports fractional values, and defaults to 10 seconds.
When the timeout expires, SRS releases both the stream ID and SSRC so the
external SIP server can publish them again.
Once the media TCP connection binds, the connection owns the media-session
lifecycle and `media_connect_timeout` no longer applies. Closing the current TCP
connection destroys the session and releases its stream ID and SSRC. A later
publish request may therefore reuse both values.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |