Quickstart: push a feed to TRaX with OBS or ffmpeg
Ten minutes from an input to a live feed. You need one thing: the input's publish URL, which carries the host, the stream path and the stream key in one string. Two places hand it to you:
- From your own code: create a
generic-inputsource and callPOST /v1/studios/{id}/sources/{sourceId}/ingest. The full walk-through, including the response shape, is Stream to a live input from your app. - From the studio: open the input's Connection Information panel. It shows the same URLs, already split into the Server / Stream Key pair OBS wants.
Either way the credential is the input's stream key. It appears twice in an SRT streamid and twice in an RTMP query string, and it is the whole capability; there is no token to add. Treat the full URL as a password.
Option A — SRT (recommended)
ffmpeg
ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -b:v 4M \
-c:a aac -b:a 160k -f mpegts \
"srt://<trax-media-host>:8890?streamid=publish:<path>:<key>:<key>"
OBS
- Settings → Stream → Service: Custom…
- Server:
srt://<trax-media-host>:8890?streamid=publish:<path>:<key>:<key> - Stream Key: leave empty (everything rides in the streamid)
Do not URL-encode the streamid, and keep it under 512 bytes; see the SRT contract for the failure modes.
Option B — RTMP / RTMPS
ffmpeg
ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -b:v 4M \
-c:a aac -b:a 160k -f flv \
"rtmp://<trax-media-host>:1935/<path>?user=<key>&pass=<key>"
OBS
OBS publishes to <Server>/<Stream Key>, so the URL splits at its last /:
- Settings → Stream → Service: Custom…
- Server:
rtmp://<trax-media-host>:1935/inputs - Stream Key:
<last path segment>?user=<key>&pass=<key>
Credentials ride in the query string, not in a /live/<key> path and not in
the URL's userinfo (rtmp://user:pass@host/… is not read and fails). For RTMPS
use port 1936 and the rtmps:// scheme; plain RTMP sends the key in clear
text. See the RTMP contract.
Verify it's flowing
The input's tile in the studio's Sources panel goes live within a few seconds of the first packets, and back to offline within about five seconds of the encoder stopping. A healthy SRT contribution holds a stable round-trip and no reconnect churn; if the sender dies within the first second, check the streamid rules first.
Publishing does not take the studio on air. A live input is something the operator places on the canvas; going live to destinations is a separate step (details).
Recommended encoder settings
| Setting | Value |
|---|---|
| Video codec | H.264, high profile |
| Keyframe interval | 2 s |
| Rate control | CBR, 4–8 Mbps for 1080p60 |
| Audio | AAC 160 kbps, 48 kHz stereo |