Transport configuration
Transport configuration
This guide describes controlled changes to SRT and relay transport on a Pixop Prime appliance: what files to edit, what restarts do, and how to validate before returning to air. It assumes you have read Network and transport for topology and ports.
Capability gate: Relay templates,
TRANSPORT_BACKEND=relay, bonded listener groups, and non-default protocols in relay*.argsapply only when the relay backend is selected on a relay-capable image.tsduckctl transport(andtsduck-transport-info) are tied to the helper binary, not toTRANSPORT_BACKEND: when installed, they report native or relay effective backend. On native-only images (helper absent), configure via.envkeys, skip relay-specific sections, and usetsduckctl check/ssinstead oftransport. Confirm withpixop-version, read-onlytsduckctl check main/egress-main,command -v tsduck-transport-info(andtsduckctl transportwhen the helper is present). Instance.envfiles under/etc/pixop-live/tsduck/are oftenroot:root0600 — unprivilegedgrepon those paths is not a valid operator step; reviewTRANSPORT_BACKENDand related keys only with authorized access (e.g. approved privilege escalation or your change-control backup).
Change-control workflow
Use this sequence for any transport change in production:
-
Capture baseline (read-only) — works on any appliance:
pixop-version tsduckctl check main tsduckctl check egress-main pixop-flow --secs 5Optional on any build:
ss -uln | grep -E ':5000|:5001'.When
tsduck-transport-infois installed (command -v tsduck-transport-infosucceeds):tsduckctl transport main tsduckctl transport egress-maintsduckctl transportre-executes via sudo so relay templates (root:root0640) are readable — do not invoke baretsduck-transport-infoon template paths unless you are root or have a deliberate break-glass procedure. -
Edit one concern at a time — ingest URI, egress URI, backend switch, or latency/PID — not several unrelated edits in one maintenance window.
-
Validate relay template syntax before restart (relay backend on a relay-capable image):
tsduckctl transport main # surfaces warnings when .env and template divergeAdvanced (root or sudo):
tsduck-transport-info args … --role ingest|egress --format json— prefertsduckctl transportfor routine work. -
Restart the affected instance only:
tsduckctl restart main # ingest + internal mux path tsduckctl restart egress-main # egress SRT only -
Verify readiness — UDP bind is not SRT session health. Expect
OK: listener … bound (SRT session unverified)when introspection applies:tsduckctl check main tsduckctl check egress-main pixop-flow --secs 5When the helper is installed, re-run
tsduckctl transportif you changed relay templates orTRANSPORT_BACKEND. -
Rollback: Restore the previous file contents from your change ticket backup,
restartthe same instance, re-run checks. Native rollback: setTRANSPORT_BACKEND=nativeand restart (requires native-capable image).
Safety labels
| Label | Meaning |
|---|---|
| READ-ONLY | No service impact |
| CONFIG | File edit; no effect until restart |
| RESTART | Expect TS gap on that leg |
| APPLY | tsduckctl may rewrite .env and restart ingress |
Package updates and AMI refresh install missing *.args templates but never overwrite operator-edited files.
Per-instance file map
| Instance | Env file | Relay template (relay backend) | Default UDP |
|---|---|---|---|
main | /etc/pixop-live/tsduck/main.env | /etc/pixop-live/tsduck/main.ingest.args | 5000 |
egress-main | /etc/pixop-live/tsduck/egress-main.env | /etc/pixop-live/tsduck/egress-main.egress.args | 5001 |
egress-aux1 | egress-aux1.env | egress-aux1.egress.args | 5002 |
egress-aux2 | egress-aux2.env | egress-aux2.egress.args | 5003 |
Shared backbone multicast and TS_TARGET_BITRATE live in /etc/pixop-live/network.env (and duplicated keys on main.env where noted in Configuration). Changing backbone bitrate does not change SRT ports.
Native backend (native SRT and rollback)
Set in the instance .env:
TRANSPORT_BACKEND=nativePrimary keys (typical):
| Key | Ingress (main) | Egress (egress-main) |
|---|---|---|
SRT_LISTEN_ADDR | 0.0.0.0 | 0.0.0.0 |
SRT_PORT | 5000 | 5001 |
SRT_PASSPHRASE | filled at first boot | filled at first boot |
SRT_PBKEYLEN | 16 | 32 |
Native ingress uses nested TSDuck -I srt; egress uses -O srt with passphrase file indirection inside the container. There is no main.ingest.args on a pure native workflow unless you migrate to relay later.
RESTART after any .env transport key change.
Relay backend (relay-capable appliances)
Set:
TRANSPORT_BACKEND=relayTemplates are one CLI flag per line (# comments allowed). Required structural flags:
| Role | Required flags |
|---|---|
| Ingest | --output stdout (MPEG-TS to TSDuck merge), --exit-on-output-failure true on default primary template |
| Egress | --input stdin (MPEG-TS from TSDuck fork) |
Placeholder:
| Token | Source |
|---|---|
@SRT_PASSPHRASE@ | Replaced at runtime from SRT_PASSPHRASE in the instance .env via tsduck-relay-transport (memfd; not left on disk) |
Do not put the live passphrase in the template. HTTP for embedded relay binds to 127.0.0.1 with --control-enabled false and --metrics-enabled false in shipped templates.
Shipped relay templates (do not replace wholesale)
Package templates are one flag per line under /etc/pixop-live/tsduck/. Edit transport URIs in place — do not delete structural flags. Placeholder @SRT_PASSPHRASE@ is substituted at runtime from the instance .env (never paste live secrets into *.args).
Complete primary ingest template (matches shipped main.ingest.args):
--strict-config
--input-connected-stall-recovery-ms 3000
--input srt://0.0.0.0:5000?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=16&rcvbuf=52428688&peeridletimeo=3000&conntimeo=3000&linger=0
--output stdout
--http-host 127.0.0.1
--http-port 9464
--control-enabled false
--metrics-enabled false
--exit-on-output-failure true
--stats-interval-ms 30000Complete primary egress template (matches shipped egress-main.egress.args):
--strict-config
--input stdin
--output srt://0.0.0.0:5001?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=32&sndbuf=52428688&linger=0
--http-host 127.0.0.1
--http-port 9465
--control-enabled false
--metrics-enabled false
--stats-interval-ms 30000URI-only fragments (swap into the existing --input / --output line — keep all other flags):
| Role | Fragment |
|---|---|
| Ingest listener | srt://0.0.0.0:5000?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=16&rcvbuf=52428688&peeridletimeo=3000&conntimeo=3000&linger=0 |
| Egress listener | srt://0.0.0.0:5001?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=32&sndbuf=52428688&linger=0 |
| Ingest caller (example) | srt://203.0.113.10:5000?mode=caller&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=16 |
Use documentation-only addresses (203.0.113.0/24, 198.51.100.0/24). Replace with your peer IPs. RESTART the affected instance after URI edits. For caller ingest, readiness is systemd active only — local bind checks do not prove the remote peer accepted the session.
Transport protocol matrix (relay)
| Protocol | Template pattern | Passphrase | Bind check on start | Backend |
|---|---|---|---|---|
| SRT listener | srt://HOST:PORT?mode=listener&... | @SRT_PASSPHRASE@ typical | srt-udp or srt-bonded-udp | Relay |
| SRT caller | srt://HOST:PORT?mode=caller&... | typical | active only | Relay |
| UDP MPEG-TS | udp://0.0.0.0:PORT | omit @SRT_PASSPHRASE@ in template | active only | Relay |
| RIST (opaque TS) | avio+rist://@0.0.0.0:PORT | none in template | active only | Relay; validate end-to-end before production |
| RTMP pull | avformat+rtmp://host/app/stream | stream key in URL (secret) | active only | Build-dependent experimental path; demux/remux — not byte-exact TS |
| RTMP push listener | avformat+rtmp://0.0.0.0:1935?auth=... | auth secret | active only | Experimental; confirm libsrt/relay build and partner workflow before relying on listener mode |
| RTMPS listener | — | — | Not qualified in default templates | — |
MPEG-TS semantics: Relay stdin/stdout paths are byte-exact MPEG-TS. Prefer avio+ for opaque TS (for example RIST). avformat+ demux/remux is not byte-exact — do not stack remux on top of native TS when you need transparent PID layout.
PMT / program edits: Routine operator work uses ORIGINAL_VIDEO_PID, INPUT_PCR_PID, and tsduckctl detect-video-pid — not manual PMT mutation in relay args. Do not document or attempt unsupported PSI surgery in transport templates.
Ingress stall recovery (relay, SRT listener only): Shipped main.ingest.args includes --input-connected-stall-recovery-ms 3000. Remove this line if you switch the template to UDP, RIST, or RTMP — it is meaningful only on the SRT receiving-listener path.
Egress fan-out: Repeat --output lines in one egress template for independent sinks (each line is separate failover semantics, not bonding — see Multipath and bonded SRT).
Credentials and permissions
| Asset | Path | Mode / owner |
|---|---|---|
| Instance secrets | /etc/pixop-live/tsduck/*.env | root:root 0600 |
| Relay templates | /etc/pixop-live/tsduck/*.ingest.args, *.egress.args | root:root 0640; use tsduckctl transport (self-sudo) — not bare tsduck-transport-info as ec2-user |
View connection parameters:
tsduckctl credentialsREAD-ONLY but output contains passphrases in clear text — treat like key material.
Aux egress: SRT_PASSPHRASE empty until you set it; tsduckctl start / start-all skip unconfigured aux instances.
Pipeline timing and bitrate (not SRT URI)
These live in main.env / network.env and affect mux behavior, not the WAN protocol:
| Setting | Range / default | Tool |
|---|---|---|
PIPELINE_LATENCY | 200–1500 ms (default 600) | tsduckctl tune-latency main then --apply after review |
TS_TARGET_BITRATE | default 50 Mbps (network.env) | manual edit; affects backbone pressure (pixop-flow exit 3) |
ORIGINAL_VIDEO_PID / INPUT_PCR_PID | from stream | tsduckctl detect-video-pid main then --apply after review |
PIPELINE_LATENCY and PID apply commands RESTART primary ingress when --apply is used.
Video loss policy
In main.env:
PIXOP_VIDEO_LOSS_POLICY=fail-closed # default
# PIXOP_VIDEO_LOSS_POLICY=fail-openfail-open keeps the TS emitting when Pixop replacement disappears; it does not pass through the original encoder video. Change only with explicit operational approval.
Egress startup drain
egress-main.env sets EGRESS_STARTUP_DRAIN_MS=2000 — discards roughly two seconds of merged TS at TS_TARGET_BITRATE after start/reconnect. Expect downstream receivers to need a moment to lock after egress RESTART.
Validation and divergence warnings
On relay-capable images with TRANSPORT_BACKEND=relay, tsduckctl transport (via tsduck-transport-info) reads SRT port and pbkeylen from relay templates. Duplicating URI fields in .env is not required; if .env and template disagree, tooling emits warnings — resolve before production.
On native backends, tsduckctl check uses SRT_PORT / SRT_LISTEN_ADDR from .env and ss for UDP bind. When the helper is installed, tsduckctl transport can still summarize native configuration. Without the helper, tsduckctl transport fails with not installed — use check and .env. If you configure relay on an image without tsduck-transport-info, start/check paths fail closed rather than guessing ports from stale env keys.
Related
- Network and transport — topology and port table
- Multipath and bonded SRT — bonded group URI
- Transport troubleshooting — when validation fails
- tsduckctl, tsduck-transport-info
Updated about 8 hours ago
