Transport configuration
Transport configuration
Controlled changes to SRT and relay transport on a Pixop Prime appliance: which files to edit, when to restart, and how to validate before returning to air. Read Network and transport first for topology, ports, and the native vs relay capability matrix.
Before you begin
Know your image. On the appliance, run pixop-version. Relay templates, TRANSPORT_BACKEND=relay, bonded listener groups, and non-default protocols in *.args apply only on relay-capable images with the relay backend selected. On native-only images (no transport helper), set transport via .env keys, use the native backend section below, and skip relay-specific sections.
Pick your introspection commands. When command -v tsduck-transport-info succeeds, use tsduckctl transport <instance> (and tsduckctl check) for read-only status on native or relay. When the helper is absent, use tsduckctl check, tsduckctl credentials, and ss -uln | grep -E ':5000|:5001' instead — tsduckctl transport is not available.
Change-control workflow
Use this sequence for any transport change in production:
-
Capture baseline (read-only) — on any appliance:
pixop-version tsduckctl check main tsduckctl check egress-main pixop-flow --secs 5When the transport helper is installed, also run:
tsduckctl transport main tsduckctl transport egress-main -
Edit one concern at a time — ingest URI, egress URI, backend switch, or latency/PID — not several unrelated edits in one window.
-
Validate relay template syntax (relay backend only) before restart:
tsduckctl transport mainThis surfaces warnings when
.envand template diverge. For advanced JSON output (root/sudo):tsduck-transport-info args … --role ingest|egress --format json. -
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 5Re-run
tsduckctl transportif you changed relay templates orTRANSPORT_BACKEND. -
Rollback — Restore file contents from your change ticket backup,
restartthe same instance, re-run checks. For native rollback: setTRANSPORT_BACKEND=nativeand restart (requires a 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, --exit-on-input-failure false on default primary template |
| Egress | --input stdin (MPEG-TS from TSDuck fork), --exit-on-input-failure true (no --exit-on-output-failure true on default egress templates; SRT caller flap is output-side) |
Placeholders and .env (AMI 1.0.32+)
.env (AMI 1.0.32+)Allowlisted tokens are resolved at runtime from the instance .env by tsduck-relay-transport into a memfd — not shell-expanded. Edit .env for default listener port, buffers, and SRT socket timers; keep shipped *.args placeholders unless you need bonded, RTMP, or RIST literals. Do not put the live passphrase in the template.
| Token | .env key | Notes |
|---|---|---|
@SRT_LISTEN_ADDR@ | SRT_LISTEN_ADDR | Default single-path listener bind |
@SRT_PORT@ | SRT_PORT | |
@SRT_PBKEYLEN@ | SRT_PBKEYLEN | |
@SRT_PASSPHRASE@ | SRT_PASSPHRASE | Removed from container env before relay exec |
@SRT_RCVBUF@ | SRT_RCVBUF | Ingress default template |
@SRT_SNDBUF@ | SRT_SNDBUF | Egress default templates |
@SRT_PEER_IDLE_TIMEOUT@ | SRT_PEER_IDLE_TIMEOUT | URI peeridletimeo= (ingress) |
@SRT_CONN_TIMEOUT@ | SRT_CONN_TIMEOUT | URI conntimeo= (ingress) |
@SRT_STATS_INTERVAL@ | SRT_STATS_INTERVAL | Relay --stats-interval-ms |
Shipped relay templates bind HTTP to 127.0.0.1 with control and auth disabled, TLS off, and --metrics-enabled true (loopback Prometheus only). Older baked images may differ until rebake or on-instance template edit — confirm with tsduckctl transport <instance>.
Shipped relay templates (do not replace wholesale)
Package templates live under /etc/pixop-live/tsduck/. Edit transport URIs in place — do not delete structural flags.
Primary ingest (main.ingest.args):
--strict-config
--input-connected-stall-recovery-ms 3000
--input srt://@SRT_LISTEN_ADDR@:@SRT_PORT@?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=@SRT_PBKEYLEN@&rcvbuf=@SRT_RCVBUF@&peeridletimeo=@SRT_PEER_IDLE_TIMEOUT@&conntimeo=@SRT_CONN_TIMEOUT@&linger=0
--output stdout
--http-host 127.0.0.1
--http-port 9464
--control-enabled false
--auth-enabled false
--http-tls-enabled false
--metrics-enabled true
--stats-interval-ms @SRT_STATS_INTERVAL@
--io-timeout-ms 1000
--exit-on-input-failure false
--exit-on-output-failure true
--links-compact-sides input
--links-compact-disconnect-delay-ms 60000Primary egress (egress-main.egress.args):
--strict-config
--input stdin
--output srt://@SRT_LISTEN_ADDR@:@SRT_PORT@?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=@SRT_PBKEYLEN@&sndbuf=@SRT_SNDBUF@&linger=0
--http-host 127.0.0.1
--http-port 9465
--control-enabled false
--auth-enabled false
--http-tls-enabled false
--metrics-enabled true
--stats-interval-ms @SRT_STATS_INTERVAL@
--io-timeout-ms 1000
--exit-on-input-failure trueURI-only fragments — swap into the existing --input / --output line; keep all other flags:
| Role | Fragment |
|---|---|
| Ingest listener | srt://@SRT_LISTEN_ADDR@:@SRT_PORT@?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=@SRT_PBKEYLEN@&rcvbuf=@SRT_RCVBUF@&peeridletimeo=@SRT_PEER_IDLE_TIMEOUT@&conntimeo=@SRT_CONN_TIMEOUT@&linger=0 |
| Egress listener | srt://@SRT_LISTEN_ADDR@:@SRT_PORT@?mode=listener&transtype=live&passphrase=@SRT_PASSPHRASE@&pbkeylen=@SRT_PBKEYLEN@&sndbuf=@SRT_SNDBUF@&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 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@ | 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; demux/remux — not byte-exact TS |
| RTMP push listener | avformat+rtmp://0.0.0.0:1935?auth=... | auth secret | active only | Experimental; confirm build and partner workflow |
| RTMPS listener | — | — | Not qualified in default templates | — |
Relay stdin/stdout paths are byte-exact MPEG-TS. Prefer avio+ for opaque TS (for example RIST). avformat+ demux/remux is not byte-exact.
PMT / program edits — use ORIGINAL_VIDEO_PID, INPUT_PCR_PID, and tsduckctl detect-video-pid, not manual PMT changes in relay args.
Ingress stall recovery — Shipped main.ingest.args sets --input-connected-stall-recovery-ms 3000 for SRT listener ingest only. Remove this line if you switch to UDP, RIST, or RTMP.
Relay I/O timeout vs SRT socket timers — Templates use --io-timeout-ms 1000 (relay process I/O deadline). This is independent of URI peeridletimeo / conntimeo from .env (SRT_PEER_IDLE_TIMEOUT, SRT_CONN_TIMEOUT, default 3000 ms). Relay bumps stall recovery to at least 2 × io_timeout; the shipped 1000 / 3000 pair keeps recovery at 3 s. Do not raise --io-timeout-ms to “match” WAN latency — use .env socket timers and tsduckctl tune-latency for PIPELINE_LATENCY. If you must change --io-timeout-ms, set --input-connected-stall-recovery-ms to at least 2× that value.
Egress fan-out — Repeat --output lines in one egress template for independent sinks (not bonding — see Multipath and bonded SRT).
Image compatibility and permissions
| Topic | Operator note |
|---|---|
Instance .env | /etc/pixop-live/tsduck/*.env — root:root 0600. Review transport keys with authorized access (sudo or change-control backup), not unprivileged grep. |
| Relay templates | *.ingest.args / *.egress.args — root:root 0640. Use tsduckctl transport (self-sudo); avoid bare tsduck-transport-info as ec2-user. |
TRANSPORT_BACKEND | native or relay per instance. relay without the helper and templates fails closed at start. |
| Source of truth (relay) | .env owns default single-path SRT listener settings; tooling warns when literals in *.args disagree. |
| Source of truth (native) | SRT_PORT / SRT_LISTEN_ADDR in .env; tsduckctl check and ss for bind. |
Full capability comparison: Network and transport — Release and transport compatibility.
View connection parameters:
tsduckctl credentialsREAD-ONLY — 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.
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 22 days ago
