Toolkit

Perfect Streamer MPEG TS PCR Analyzer Free Toolkit v 1.2

Free MPEG-TS PCR (Program Clock Reference) analyzer with a command line interface, checking compliance with the TR 101 290 and ISO/IEC 13818-1 (T-STD) standards.

Downloadable by the link: https://pstreamer.tv/distrib/pcr_analyzer/pss_pcr_analyzer_v_1.2.zip

Features

  • PCR Interval - checks the repeatability of the PCR interval on the value of 40 ms (TR 101 290 §1.4, Priority 1) and 25 ms (recommendations)

  • PCR Accuracy / Jitter - measures the PCR offset relative to real time (live) or interval jitter (file), checked on ±500 ns (TR 101 290 §2.3, Priority 2)

  • PCR Drift - clock drift in ppm (only in live mode)

  • T-STD Buffer Model - detection of overflow/underflow of the transport buffer according to ISO/IEC 13818-1 §2.4.2 (buffer sizes from Table 2-36, leak rate from §2.4.2.3)

  • PAT/PMT auto-discovery via libdvbpsi - no need to specify PIDs manually

  • RTP de-encapsulation - processes RTP-over-UDP transparently

  • Full & short reports with PASS/FAIL results and percentile statistics

Standards

Check

Standard

Section

Limits

PCR repetition error

ETSI TR 101 290

§1.4 (Priority 1)

≤ 40 ms

PCR accuracy error

ETSI TR 101 290

§2.3 (Priority 2)

± 500 ns

PCR clock drift

ITU-T J.83 / DVB guidelines

± 30 ppm

T-STD buffer model

ISO/IEC 13818-1 (MPEG-2 Systems)

§2.4.2

No overflow/underflow

T-STD buffer sizes (TBn, MBn)

ISO/IEC 13818-1

Table 2-36

TBn=512 B, MBn video ≤ 6 Mbit

T-STD leak rate (Rxn)

ISO/IEC 13818-1

§2.4.2.3

1.2 Mbit/s (video)

PCR discontinuity indicator

ISO/IEC 13818-1

§2.4.3.5

T-STD Buffer Model

T-STD (Transport Stream System Target Decoder) is defined in ISO/IEC 13818-1 (MPEG-2 Systems), Section 2.4.2. It specifies the decoder model that all corresponding transport streams must satisfy - no buffer in the model should overflow or underflow during normal operation.

The model consists of a chain of buffers for each elementary stream:

  • TBn (Transport Buffer) - receives TS packets with the transport speed; size is defined in Table 2-36 (512 bytes for all stream types)

  • MBn (Multiplexing Buffer) - smooths the multiplexed stream; the maximum size Bmax depends on the stream type (up to 6 Mbit for video, according to Table 2-36)

  • EBn (Elementary stream Buffer) - sends data to the decoder with the encoded speed

This implementation uses a simplified buffer leakage model: incoming packets fill the buffer with the transport speed, while data is sent at the speed Rxn defined in §2.4.2.3 (1.2 Mbit/s for the video elementary stream). Overflow means that the stream is sending data faster than the decoder can consume it; underflow means that the decoder is stuck.

Related standards:

  • ISO/IEC 13818-1:2022 - Information technology - Generic coding of moving pictures and associated audio information: Systems

  • ETSI TR 101 290 V1.4.1 - Digital Video Broadcasting (DVB); Measurement guidelines for DVB systems

  • ITU-T Rec. H.222.0 - identical to ISO/IEC 13818-1

  • ETSI TS 101 154 - DVB: Specification for the use of Video and Audio Coding in Broadcasting Applications (defines buffer limits for specific streams)

Usage

$ pcr_analyzer [options] <input>

Input formats

UDP multicast:

$ pcr_analyzer udp://239.1.1.1:1234

UDP multicast on a specific interface:

$ pcr_analyzer udp://eth0@239.1.1.1:1234

UDP unicast:

$ pcr_analyzer udp://192.168.1.100:1234

TS file:

$ pcr_analyzer /path/to/file.ts

Example report:

PCR PID 0x0101 (257)
-------------------------------------------------------------------------
PCR packets received  : 1500
Discontinuities       : 0
Estimated bitrate     : 18.750 Mbit/s

┌─ PCR INTERVAL (TR 101 290 §1.4) ──────────────────
│  Samples     : 1499  Min         : 19.812 ms
│  Max         : 20.195 ms
│  Average     : 20.001 ms
│  95th pctl   : 20.102 ms
│  Limit       : 40.000 ms (max), 25.000 ms (rec)  Violations  : 0 (>40ms), 0 (>25ms)  Result      : PASS
└───────────────────────────────────────────────────

┌─ PCR ACCURACY / JITTER (TR 101 290 §2.3) ────────
│  Samples     : 1499  Min offset  : -148.3 ns
│  Max offset  : 201.7 ns
│  Abs max     : 201.7 ns
│  Average     : 2.1 ns
│  Std dev     : 45.6 ns
│  95th pctl   : 102.3 ns
│  Limit       : ±500.0 ns
│  Violations  : 0  Result      : PASS
└───────────────────────────────────────────────────

┌─ PCR DRIFT ────────────────────────────────────────
│  Current drift : 0.128 ppm
│  Limit         : ±30 ppm (typical)  Result        : PASS
└───────────────────────────────────────────────────

┌─ T-STD BUFFER MODEL (ISO 13818-1 §2.4.2) ────────
│  Overflows    : 0  Underflows   : 0  Max fill     : 34218 bytes
│  Result       : PASS
└───────────────────────────────────────────────────

========================================================================
OVERALL COMPLIANCE: PASS   stream is TR 101 290 compliant
========================================================================

A more advanced version of the analyzer with graphs and reports, checking compliance with all hundred streams running on the server in real time is available in the full version of Perfect Streamer and Perfect Streamer Demo on 10 streams. In subsequent updates of the program, the analyzer will be further significantly improved. This is not a cloud analyzer, here there is no need for constant subscription to the software, everything works offline on your server.