pixop-timing-probe

pixop-timing-probe

Measure MPEG-TS timing between the pre-Pixop tap (:5500 by default) and post-Pixop replacement feed (:5501) using TSDuck pcrextract probes. Supports latency tuning workflows with tsduckctl tune-latency main (reads pixop-timing-probe --json).

Availability: Verify this tool on your appliance with command -v pixop-timing-probe and pixop-version (the tool may report its own semver, for example 2.1.0, independent of the AMI recipe). Run pixop-timing-probe -h for flags. Installed path when present: /opt/pixop/bin/pixop-timing-probe. Requires root (auto sudo via absolute script path unless PIXOP_TIMING_PROBE_NOSUDO=1).

Purpose and scope

Read-only with respect to appliance configuration: spawns short-lived TSDuck docker run or host tsp listeners, correlates matched PTS values, and prints diagnostics. Does not write PIPELINE_LATENCY unless you use tsduckctl tune-latency main --apply separately.

Requires a live stream on both endpoints with timestamp passthrough and correct video/PCR PIDs. A bare pixop-timing-probe does not load main.env; use pixop-timing-probe main to load /etc/pixop-live/tsduck/main.env timing keys (passphrases in that file are ignored).

Usage summary

pixop-timing-probe [NAME] [options]
OptionDefault / notes
NAMELoad timing keys from /etc/pixop-live/tsduck/NAME.env
--input / --outputUDP endpoints; defaults from tap/replacement env or 239.0.0.1:5500 / :5501
--input-pid, --input-pcr-pid, --output-pid, --output-pcr-pidPIDs; hex allowed
--samples500 matched PTS pairs
--timeout30 seconds
--percentile99 (nearest-rank for tail stats)
--guard-frames0 extra frames on arrival holdback
--result alignment|arrivalStdout integer: timestamp alignment (default) or arrival holdback
--evaluate-offset-msEvaluate candidate offset; defaults to PIPELINE_LATENCY when set in env
--socket-bufferUDP buffer; default REPLACEMENT_IP_BUFFER_SIZE or 8388608
--docker-imageTSDuck image; else TSDUCK_IMAGE / tag from env
--allow-non-kernelAllow non-kernel input timestamps (not recommended)
--max-delay-msReject implausible transit delays above 10000
--jsonFull result object on stdout
--show-configResolved settings JSON, then exit
-v / --verboseTSDuck stderr to stderr
--versionProbe script version

Precedence: explicit flag → named instance file → process environment → /etc/pixop-live/tsduck.env → built-in default.

Exit codes: 0 success; 1 runtime error (no matches, probe failure); 2 configuration error; 130 interrupt.

stdout vs stderr

  • Default stdout: single integer — timestamp alignment (decode_phase_alignment_ms) unless --result arrival (arrival holdback ms).
  • Human summary and warnings go to stderr.
  • --json puts the full structure on stdout (use this for automation and tune-latency).

Key JSON fields (when present):

FieldMeaning
completetrue when usable matches ≥ --samples
arrival_holdback_msFrame-rounded tail transit holdback
decode_phase_alignment_msNearest-frame timestamp alignment recommendation
decode_safe_minimum_msLower-bound diagnostic (not a comfort margin)
transitPTS transit delay distribution (median, percentile, max)
matched_samples / requested_samplesSample counts after filtering

tsduckctl tune-latency main compares current PIPELINE_LATENCY to max(arrival_holdback_ms, decode_safe_minimum_ms) with alignment raised when reported — supported apply range 200–1500 ms inclusive (see tsduckctl source/docs).

Operator workflows

Primary pipeline with instance env (recommended):

pixop-timing-probe main --json | jq '{complete, arrival_holdback_ms, decode_phase_alignment_ms, decode_safe_minimum_ms}'

Shell-friendly integer (default --result alignment):

ALIGNMENT_MS="$(pixop-timing-probe main)"
echo "$ALIGNMENT_MS"

Verify resolved endpoints before a long capture:

pixop-timing-probe main --show-config

Arrival holdback only:

pixop-timing-probe main --result arrival

Run only while pixop-flow shows traffic on :5500 and :5501 and PIDs match your program.

Troubleshooting

Error / symptomAction
no matching PTS values were observedWrong endpoints/PIDs, no multicast, or passthrough disabled — confirm with pixop-flow and tsduckctl detect-video-pid main
kernel timestamps failureProbes require kernel TSP timestamps; fix tap path or use --allow-non-kernel only if clocks are comparable
timed out ... only N/M usable matched samplesPartial result; increase --timeout or ensure stable source
could not derive timestamp alignmentUse --result arrival or fix B-frame / PCR sample quality
docker not found but ... TSDUCK_IMAGEDocker required when image env is set

Preflight intentionally does not run this probe (avoids false FAIL on idle hosts).

Limitations

  • Short observation window — not a 24h QoS study.
  • Identical PTS collisions in the window cannot be correlated uniquely.
  • Egress instance names are rejected by tune-latency; probe main only for primary latency policy.
  • Spawns concurrent Docker containers with --pull=never; fails if TSDuck image missing locally.

Related


Did this page help you?