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:

  1. Capture baseline (read-only) — on any appliance:

    pixop-version
    tsduckctl check main
    tsduckctl check egress-main
    pixop-flow --secs 5

    When the transport helper is installed, also run:

    tsduckctl transport main
    tsduckctl transport egress-main
  2. Edit one concern at a time — ingest URI, egress URI, backend switch, or latency/PID — not several unrelated edits in one window.

  3. Validate relay template syntax (relay backend only) before restart:

    tsduckctl transport main

    This surfaces warnings when .env and template diverge. For advanced JSON output (root/sudo): tsduck-transport-info args … --role ingest|egress --format json.

  4. Restart the affected instance only:

    tsduckctl restart main          # ingest + internal mux path
    tsduckctl restart egress-main   # egress SRT only
  5. 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 5

    Re-run tsduckctl transport if you changed relay templates or TRANSPORT_BACKEND.

  6. Rollback — Restore file contents from your change ticket backup, restart the same instance, re-run checks. For native rollback: set TRANSPORT_BACKEND=native and restart (requires a native-capable image).

Safety labels

LabelMeaning
READ-ONLYNo service impact
CONFIGFile edit; no effect until restart
RESTARTExpect TS gap on that leg
APPLYtsduckctl 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

InstanceEnv fileRelay template (relay backend)Default UDP
main/etc/pixop-live/tsduck/main.env/etc/pixop-live/tsduck/main.ingest.args5000
egress-main/etc/pixop-live/tsduck/egress-main.env/etc/pixop-live/tsduck/egress-main.egress.args5001
egress-aux1egress-aux1.envegress-aux1.egress.args5002
egress-aux2egress-aux2.envegress-aux2.egress.args5003

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=native

Primary keys (typical):

KeyIngress (main)Egress (egress-main)
SRT_LISTEN_ADDR0.0.0.00.0.0.0
SRT_PORT50005001
SRT_PASSPHRASEfilled at first bootfilled at first boot
SRT_PBKEYLEN1632

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=relay

Templates are one CLI flag per line (# comments allowed). Required structural flags:

RoleRequired 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+)

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 keyNotes
@SRT_LISTEN_ADDR@SRT_LISTEN_ADDRDefault single-path listener bind
@SRT_PORT@SRT_PORT
@SRT_PBKEYLEN@SRT_PBKEYLEN
@SRT_PASSPHRASE@SRT_PASSPHRASERemoved from container env before relay exec
@SRT_RCVBUF@SRT_RCVBUFIngress default template
@SRT_SNDBUF@SRT_SNDBUFEgress default templates
@SRT_PEER_IDLE_TIMEOUT@SRT_PEER_IDLE_TIMEOUTURI peeridletimeo= (ingress)
@SRT_CONN_TIMEOUT@SRT_CONN_TIMEOUTURI conntimeo= (ingress)
@SRT_STATS_INTERVAL@SRT_STATS_INTERVALRelay --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 60000

Primary 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 true

URI-only fragments — swap into the existing --input / --output line; keep all other flags:

RoleFragment
Ingest listenersrt://@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 listenersrt://@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)

ProtocolTemplate patternPassphraseBind check on startBackend
SRT listenersrt://HOST:PORT?mode=listener&...@SRT_PASSPHRASE@ typicalsrt-udp or srt-bonded-udpRelay
SRT callersrt://HOST:PORT?mode=caller&...typicalactive onlyRelay
UDP MPEG-TSudp://0.0.0.0:PORTomit @SRT_PASSPHRASE@active onlyRelay
RIST (opaque TS)avio+rist://@0.0.0.0:PORTnone in templateactive onlyRelay; validate end-to-end before production
RTMP pullavformat+rtmp://host/app/streamstream key in URL (secret)active onlyBuild-dependent; demux/remux — not byte-exact TS
RTMP push listeneravformat+rtmp://0.0.0.0:1935?auth=...auth secretactive onlyExperimental; 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

TopicOperator 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_BACKENDnative 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 credentials

READ-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:

SettingRange / defaultTool
PIPELINE_LATENCY200–1500 ms (default 600)tsduckctl tune-latency main then --apply after review
TS_TARGET_BITRATEdefault 50 Mbps (network.env)manual edit; affects backbone pressure (pixop-flow exit 3)
ORIGINAL_VIDEO_PID / INPUT_PCR_PIDfrom streamtsduckctl 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-open

fail-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


Did this page help you?