SRT: the streamid contract
SRT is the recommended contribution protocol for TRaX: encrypted, loss-tolerant, low-latency. All routing and authentication for an SRT connection rides in the streamid field.
Format
<action>:<path>:<user>:<pass>
| Field | Values |
|---|---|
action |
publish (send a feed) or read (pull a feed) |
path |
The stream path (see path grammar); inputs/generic-input-<id> for an input created over /v1 |
user / pass |
The credential. For publishing to an input, the input's stream key in both positions |
Complete publish URL:
srt://<trax-media-host>:8890?streamid=publish:<path>:<stream-key>:<stream-key>
You do not assemble this yourself. The complete field of the
ingest endpoint
(or the studio's Connection Information panel) hands you the whole URL; the
studio may also append &latency= and &oheadbw= tuning to it, which the
sender applies.
Reading uses the same grammar with action = read and a read credential the
platform issues for that path.
Hard rules
- Do not URL-encode the streamid. The SRT library and the TRaX edge parse the
raw string with literal
:delimiters. Encoders that percent-encode the streamid fail authentication. - 512-byte cap. libsrt hard-caps the streamid at 512 bytes. A stream-key
streamid is well under that; never append extra fields to it or wrap it in
anything. Overflow does not fail cleanly: the sender typically dies within
the first second with an unhelpful
Bad parameters/ rejected-handshake error. - One key, one path, one action. The key authenticates publishing to the path it was issued for, and nothing else. A key from one input does not open another.
Failure modes
| Symptom | Likely cause |
|---|---|
Immediate disconnect (<1s), Bad parameters |
streamid over 512 bytes, or edited |
| Handshake rejected | URL-encoded streamid, a mangled or revoked key, or a key used against a different path |
| Connects, no media routed | Wrong path: the connection authenticated but the path isn't the input you expect |
Encoder quick reference
ffmpeg:
ffmpeg -re -i input.mp4 -c copy -f mpegts \
"srt://<trax-media-host>:8890?streamid=publish:<path>:<stream-key>:<stream-key>"
OBS: Settings → Stream → Service Custom, server
srt://<trax-media-host>:8890?streamid=publish:<path>:<stream-key>:<stream-key>,
stream key empty. libsrt: set SRTO_STREAMID to everything after streamid=.
See the OBS / ffmpeg quickstart.