Dump output examples¶
Annotated text output of the dump flags, run against the bundled streams in
sample_data/.
Dump TS header¶
$ ./mpeg-ts-analyzer sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts --dump-ts-header
Input file: sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts
===============================================================
TS Header
===============================================================
transport_error_indicator : 0
payload_unit_start_indicator : 1
transport_priority : 0
pid : 0x0
transport_scrambling_control : 0
adaptation_field_control : 1
continuity_counter : 0
===============================================================
TS Header
===============================================================
transport_error_indicator : 0
payload_unit_start_indicator : 1
transport_priority : 0
pid : 0x1000
transport_scrambling_control : 0
adaptation_field_control : 1
continuity_counter : 0
===============================================================
TS Header
===============================================================
transport_error_indicator : 0
payload_unit_start_indicator : 1
transport_priority : 0
pid : 0x100
transport_scrambling_control : 0
adaptation_field_control : 3
continuity_counter : 0
Dump PSI¶
$ ./mpeg-ts-analyzer sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts --dump-psi
Input file: sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts
Packet size: 188 bytes
Detected PAT: 1 program(s)
===========================================
PAT
===========================================
PAT : table_id : 0x0
PAT : section_syntax_indicator : 1
PAT : section_length : 13
PAT : transport_stream_id : 1
PAT : version_number : 0
PAT : current_next_indicator : 1
PAT : section_number : 0
PAT : last_section_number : 0
PAT : program_number : 1
PAT : program_map_PID : 0x1000
PAT : CRC_32 : 2ab104b2
Detected PMT
===========================================
PMT
===========================================
PMT : table_id : 0x2
PMT : section_syntax_indicator : 1
PMT : section_length : 29
PMT : program_number : 1
PMT : version_number : 0
PMT : current_next_indicator : 1
PMT : section_number : 0
PMT : last_section_number : 0
PMT : PCR_PID : 0x100
PMT : program_info_length : 0
PMT : Program Info : elementary_PID : 0x100, stream_type : 0x02 (13818-2 video or 11172-2 constrained parameter video stream)
PMT : Program Info : elementary_PID : 0x101, stream_type : 0x03 (11172 audio)
PMT : descriptor : ISO 639 language descriptor
PMT : language_code : eng
PMT : audio_type : 0x00 (undefined)
PMT : CRC_32 : 11625f80
A table split into several sections is printed one section at a time, in
section_number order (see
Multi-section PAT and PMT).
Descriptors found in a program's ES info loop are decoded and printed under the
corresponding Program Info line (as seen above for the audio stream's ISO 639
language descriptor). Other descriptor types are decoded similarly; for example
an AVC video descriptor on an H.264 stream is dumped as:
PMT : Program Info : elementary_PID : 0x100, stream_type : 0x1b (AVC video stream as defined in ITU-T Rec. H.264|ISO/IEC 14496-10 Video)
PMT : descriptor : AVC video descriptor
PMT : profile_idc : 100 (High)
PMT : level_idc : 40 (4.0)
mpeg-ts-analyzer decodes a curated set of the most commonly encountered descriptors rather than aiming for exhaustive coverage. Descriptors outside this set are still reported by tag with their raw payload, so nothing is silently dropped.
Decoded descriptors, grouped by the standard that defines them (the descriptor_tag range decides which one applies):
- ISO/IEC 13818-1 (ITU-T H.222.0), clause 2.6 — registration (0x05), ISO 639 language (0x0A), AVC video (0x28), HEVC video (0x38)
- ETSI EN 300 468 (DVB), clause 6.2 — teletext (0x56), subtitling (0x59), AAC (0x7C)
Dump timestamp¶
--dump-timestamp prints every PCR of the program (with its interval to the
previous PCR when it is not smaller, so not at a wraparound), and every PTS or
DTS when its PES packet ends, with its
delay: the PCR-to-PTS/DTS lead of the PES packet (its DTS, or its PTS when it
has no DTS, minus the PCR at its first byte, interpolated by byte position
between the PCRs before and after it). It is the value the PCR-PTS/DTS gap
check judges and the mux lead
reports for the same PES packet: one computation, read modulo the 2^33 period
of the PTS/DTS and the PCR as the signed difference nearest to zero, so a
PTS/DTS that wraps before the PCR, or a PCR that wraps before the PTS/DTS,
gives the same delay as without a wrap, and a PES packet whose PCRs straddle a
PCR wraparound is interpolated across it.
- A PES packet that ends before the PCR after its start has arrived (a short audio PES packet, or the last one before the end of the file) shows its delay against the previous PCR alone. The gap check does not count it, because the previous PCR overstates the delay at a later byte position.
- No delay is printed for a PES packet before the first PCR, or whose PCRs lie
in different timing segments (a declared or undeclared discontinuity, or a
PCR_PIDchange; see PCR steps).
$ ./mpeg-ts-analyzer sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts --dump-timestamp
Input file: sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts
Packet size: 188 bytes
Detected PAT: 1 program(s)
Detected PMT
PMT : Program Info : elementary_PID : 0x100, stream_type : 0x02 (13818-2 video or 11172-2 constrained parameter video stream)
PMT : Program Info : elementary_PID : 0x101, stream_type : 0x03 (11172 audio)
0x000034e0 PCR: 0x018344a0[00940.000000ms]
0x000034e0 DTS: 0x00024090[01640.000000ms] (pid:0x100) (delay:700.000000ms)
0x0000359c PTS: 0x00023a3a[01621.977778ms] (pid:0x101) (delay:681.977778ms)
0x00004970 PCR: 0x01a43a20[01020.000000ms] (Interval:00080.000000ms)
0x00003f28 DTS: 0x00024ea0[01680.000000ms] (pid:0x100) (delay:700.000000ms)
0x00004970 DTS: 0x00025cb0[01720.000000ms] (pid:0x100) (delay:700.000000ms)
0x00003fe4 PTS: 0x00024b1a[01669.977778ms] (pid:0x101) (delay:687.120635ms)
0x000055ec PCR: 0x01c52fa0[01100.000000ms] (Interval:00080.000000ms)
0x00004ba4 DTS: 0x00026ac0[01760.000000ms] (pid:0x100) (delay:725.882353ms)
0x00004c60 PTS: 0x00025bfa[01717.977778ms] (pid:0x101) (delay:679.154248ms)
0x000055ec DTS: 0x000278d0[01800.000000ms] (pid:0x100) (delay:700.000000ms)
0x000056a8 PTS: 0x00026cda[01765.977778ms] (pid:0x101) (delay:665.977778ms)
(snip)
0x0004a66c PCR: 0x091bd920[05660.000000ms] (Interval:00080.000000ms)
0x00049c24 DTS: 0x0008ade0[06320.000000ms] (pid:0x100) (delay:725.882353ms)
0x00049ce0 PTS: 0x00089f1a[06277.977778ms] (pid:0x101) (delay:679.154248ms)
0x0004a728 PTS: 0x0008affa[06325.977778ms] (pid:0x101) (delay:665.977778ms)
0x0004b0b4 PTS: 0x0008c0da[06373.977778ms] (pid:0x101) (delay:713.977778ms)
0x0004a66c DTS: 0x0008bbf0[06360.000000ms] (pid:0x100) (delay:700.000000ms)
0x0004bbb8 PTS: 0x0008d1ba[06421.977778ms] (pid:0x101) (delay:761.977778ms)
-----------------------------
TS Sync: no sync loss detected
-----------------------------
Compliance Check Results:
Max PCR interval: 80.000000ms [OK, limit: <= 100.000000ms]
PCR discontinuities: 0 undeclared in 60 PCRs [OK]
PCR-PTS/DTS max gap: 726.666667ms [OK, limit: <= 1000.000000ms]
Across a wraparound, in the intentionally unusual
sample_data/diagnostics/sample_188byte_pts_gap_wraparound.ts (video DTS lead 700 ms,
audio PTS lead 30 ms, AAC PTS lead -150 ms; the PCR wraps between the PCRs at
0x000047f8 and 0x00004ae8, the video DTS earlier, the AAC PTS later), every
delay stays the lead of its stream:
0x000047f8 PCR: 0x257ffef8540[95443677.688889ms] (Interval:00080.000000ms)
0x00004508 DTS: 0x0000cbe8[00580.000000ms] (pid:0x100) (delay:700.000000ms)
0x000045c4 PTS: 0x1ffffe764[95443647.688889ms] (pid:0x101) (delay:30.000000ms)
0x0000473c PTS: 0x1ffffb62c[95443507.688889ms] (pid:0x102) (delay:-150.000000ms)
0x00004ae8 PCR: 0x00107ac0[00040.000000ms]
0x000047f8 DTS: 0x0000e808[00660.000000ms] (pid:0x100) (delay:700.000000ms)
0x000048b4 PTS: 0x00000384[00010.000000ms] (pid:0x101) (delay:30.000000ms)
0x00004a2c PTS: 0x1ffffd24c[95443587.688889ms] (pid:0x102) (delay:-150.000000ms)
0x00004dd8 PCR: 0x00317040[00120.000000ms] (Interval:00080.000000ms)
0x00004ae8 DTS: 0x00010428[00740.000000ms] (pid:0x100) (delay:700.000000ms)
0x00004ba4 PTS: 0x00001fa4[00090.000000ms] (pid:0x101) (delay:30.000000ms)
0x00004d1c PTS: 0x1ffffee6c[95443667.688889ms] (pid:0x102) (delay:-150.000000ms)
Dump PCR jitter¶
--dump-pcr-jitter reports PCR jitter — the error in each PCR value, i.e.
how far the stamped clock is from the time that byte was actually delivered. This
is a different concern from the PCR interval check above (how often a PCR
appears): a PCR can arrive on time yet carry a wrong value, which upsets the
decoder's clock recovery (audio pops, video stutter).
$ ./mpeg-ts-analyzer sample_data/diagnostics/sample_188byte_all_findings.ts --dump-pcr-jitter
...
-----------------------------
PCR Jitter Summary (per-interval, byte-position model):
(file-based estimate; judged only when the stream shows constant delivery, not a TR 101 290 measurement)
Samples : 55 PCR in 1 segment(s)
Measured : 53 interior samples
Max jitter : +0.100000ms at 0x00002a98
Min jitter : -0.050000ms at 0x00002920
Avg |jitter| : 0.003774ms
Within +/-500ns : 94.3% (ISO/IEC 13818-1 accuracy limit)
Delivery : CONSTANT - the multiplex rate of 2 one-second windows deviates up to 0.00% from the average 75,200 b/s (tolerance 1%)
Status : NG (max |jitter| exceeds the +/-25 microsec DVB limit)
Discontinuities : 0
A file has no real arrival timestamps, so the jitter of each PCR is estimated from its byte position: it is compared with the value interpolated from its two neighbors, which is exact only when the multiplex is delivered at a constant rate. Jitter magnitudes are printed in milliseconds (six decimals, so 1 ns is resolvable).
Because a PCR error and a change of delivery rate look the same in a file,
Delivery first checks whether the stream itself shows constant delivery: the
multiplex rate over 1-second windows of PCR time must stay within ±1 % of the
range average, and no estimated jitter may reach the millisecond scale (1 ms)
that only a varying rate explains. CONSTANT, VARIABLE or UNKNOWN (fewer
than two windows, a range shorter than about two seconds) is followed by the
evidence. Only with CONSTANT delivery does Status grade the worst-case
|jitter| against the two standard limits:
- OK — within ±500 ns (ISO/IEC 13818-1 accuracy limit)
- WARNING — beyond ±500 ns but within ±25 µs (DVB receiver tolerance)
- NG — beyond ±25 µs
Otherwise it is NOT ASSESSABLE, and the estimate is still shown. The result is a file-based estimate, not a hardware TR 101 290 measurement, as noted in the output header.
The example is the intentionally invalid
diagnostic sample,
delivered at a constant rate with one PCR stamped 100 µs late; the same stream
without that defect reports exactly zero and OK. The bundled VBR sample is
not assessable: its PCR PID also carries VBR video and the multiplex has no
stuffing, so the byte rate varies, and the byte-position "jitter" reaches
milliseconds:
$ ./mpeg-ts-analyzer sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts --dump-pcr-jitter
...
Max jitter : +23.333333ms at 0x00026244
Min jitter : -28.679245ms at 0x00008664
Avg |jitter| : 16.822812ms
Within +/-500ns : 0.0% (ISO/IEC 13818-1 accuracy limit)
Delivery : VARIABLE - the multiplex rate of 4 one-second windows deviates up to 3.06% from the average 496,754 b/s (tolerance 1%)
Status : NOT ASSESSABLE (delivery rate is variable, so the byte-position estimate does not measure PCR accuracy)
Discontinuities : 0
The estimate is made within timing segments: a declared discontinuity, a
PCR_PID change, an undeclared backward step or a forward jump of more than
1000 ms starts a new one, and Discontinuities lists each with its kind, for
example - 0x000066d0 : backward, PCR jumped -1960.000ms (segment 3 -> 4). A
33-bit wraparound does not split the estimate. These are the same steps as in
the PCR discontinuity check.
When no estimate can be made (fewer than 3 PCRs, or too many discontinuities),
the summary says analysis skipped with the reason, still followed by the
Delivery line. PCR jitter does not affect --fail-on-error and is not a --fail-on
category. The JSON form is
described in PCR jitter.
Dump bitrate¶
--dump-bitrate summarizes how bandwidth is distributed across the analyzed
program's PIDs: the average and peak bitrate of each elementary stream,
the PSI overhead (PAT/PMT), and the program total. It answers questions like
"which stream is eating the bandwidth", "does the video meet its CBR/VBR target",
and "where does a live HLS/DASH pipeline buffer".
$ ./mpeg-ts-analyzer sample_data/sample_188byte_video_mpeg2_320x240_25fps_audio_mp2_48000Hz.ts --dump-bitrate
...
-----------------------------
Bitrate Summary (PCR time base):
PID Type Avg(bps) Peak/1s(bps)
0x0000 PAT 12,427 13,536
0x0100 13818-2 video or 11172-2 constrained parameter video stream 59,905 60,160
0x0101 11172 audio 405,952 430,144
0x1000 PMT 12,427 13,536
Total (program) 490,711 514,368
0x1fff NULL (mux-wide) 0 0
Duration: 4.72s (PCR, 1 segment(s))
Reading the output:
- Avg is the mean bitrate over the measured
Duration; Peak/1s is the busiest single 1-second window (N/Afor streams shorter than one second). - Total (program) sums the analyzed program's PIDs. NULL (
0x1FFF) stuffing is mux-wide, so it is listed separately and left out of the total. - Byte counts are TS-layer: 188 bytes per packet, including for 192-byte M2TS
and 204-byte packets. The 4-byte M2TS header and the 16-byte trailer of a
204-byte packet are not TS data, so they are left out of every bitrate (the
PCR jitter delivery rate too). The physical input rate of the whole file is
the TS rate × packet size / 188: for 204-byte packets, × 204/188, which is
what TSDuck's
tsanalyzereports asbitrate-204next tobitrate. - The segment count next to the duration reflects PCR discontinuities found in the stream (see PCR steps); a PCR wraparound keeps the clock running.