reference
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 you were provisioned (see path grammar) |
user / pass |
Credentials. JWT form: user is the literal string trax, pass is the session JWT. Stream-key form: the key in both fields |
Complete publish URL with a session JWT:
srt://<trax-media-host>:8890?streamid=publish:<path>:trax:<jwt>
With a stream key:
srt://<trax-media-host>:8890?streamid=publish:<path>:<stream-key>:<stream-key>
Reading is identical with action = read.
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 will fail authentication. - 512-byte cap. libsrt hard-caps the streamid at 512 bytes. A session JWT
consumes most of that budget — never wrap a JWT inside another JWT, and never
append extra fields to the streamid. Overflow does not fail cleanly: the
sender typically dies within the first second with an unhelpful
Bad parameters/ rejected-handshake error. - One token, one path, one action. The JWT's claims must match the
actionandpathin the streamid exactly; mismatches are rejected at handshake.
Failure modes
| Symptom | Likely cause |
|---|---|
Immediate disconnect (<1s), Bad parameters |
streamid over 512 bytes (usually a doubled/wrapped JWT) |
| Handshake rejected | Expired token, action/path mismatch with the JWT claims, or URL-encoded streamid |
| Connects, no media routed | Wrong path — the connection authenticated but the path isn't provisioned |
Encoder quick reference
ffmpeg:
ffmpeg -re -i input.mp4 -c copy -f mpegts \
"srt://<trax-media-host>:8890?streamid=publish:<path>:trax:<jwt>"
OBS: Settings → Stream → Service Custom, server
srt://<trax-media-host>:8890?streamid=publish:<path>:trax:<jwt>, stream key empty.
See the OBS / ffmpeg quickstart.