Skip to main content

πŸ“ˆ PCR Monotonicity

The Program Clock Reference (PCR) is the 27 MHz timing reference carried in MPEG-TS adaptation fields for the PMT-declared PCR PID.

PCR values are expected to move forward monotonically so decoders can maintain a stable encoder clock timeline.

What This Test Does​

The PCR Monotonicity test scans PCR-bearing packets on the selected PCR PID and records an error when PCR moves backward without a valid wraparound case.

The checker resets its PCR baseline when the transport packet sets the adaptation-field discontinuity indicator.

βœ… Pass Criteria​

The test passes when no backward PCR values are detected.

Application result message:

No backward PCR values were detected.

❌ Fail Criteria​

The test fails when one or more backward PCR values are detected.

Typical causes include:

  • Encoder clock instability
  • Timestamp rewrite or remux defects
  • Incorrect wrap handling

Application result message:

<n> PCR monotonicity errors were detected.

Example​

Passing sample result​

Passing PCR Monotonicity chart showing PCR values increasing over packet order

In this passing example, each PCR sample is greater than the previous PCR sample on the selected PCR PID. The line always moves forward, so the decoder clock timeline remains monotonic.

This is the expected shape for a clean PCR timeline: no downward steps appear unless the stream declares a valid transport discontinuity and the checker resets its PCR baseline.

Failing sample result​

This chart shows a failing transport example with detected MPEG-TS errors.

Missing PID chart

Test file​

  • klv-missing-pid.ts

PCR backward at packet 247: 72900000 -> 70200000 PCR backward at packet 499: 126900000 -> 124200000 PCR backward at packet 762: 180900000 -> 178200000 PCR backward at packet 1033: 234900000 -> 232200000