Skip to main content

MistAnalyserTS

MistAnalyserTS

This analyser matches with all ts formats.

Usage

MistAnalyserTS [options] [filename]

Options

OptionshorthandValueDefaultDescription
--debug-g1-10Set at compilation, 3 in most casesSets the debug level at which messages are printed
--detail-Dnumeral3Sets the detail level bitmask. 1 = PES, 2 = TS non-stream pkts, 4= TS stream pkts, 32 = raw PES packet bytes, 64 = raw TS packet bytes.
--help-hBinaryfalseIf set, display usage and version information then exit
--pid-PnumeralOnly use the given PID, ignore others
--raw-RstringWrite raw PES payloads to the given file
--timeout-TNumeralTime in Seconds to run the analyses task
--validate-VBinaryfalseIf set activate validation mode for load testing
--version-vBinaryfalseIf set display the library and application version, then exit

Examples & tips

What you should know:

MPEG-TS streams will repeat a Program Association Table and a Program Mapping Table, a very simple explanation for both of these is that it contains the information that you would need in order to find & use the MPEG-TS stream. The amount of variance you can encounter on MPEG-TS data is very broad and you can easily encounter something unfamiliar while still valid. So keep this in mind when analysing MPEG-TS.

Program Association Table (PAT) and Program Mapping Table (PMT)

The PAT and PMT are important information within your MPEG-TS stream. It's what applications will use to "find" what is in the stream itself. Every application will need to encounter these before they can actually use the stream information, so it's something that should be included within your MPEG-TS stream often to be considered healthy. If you only ever see one or not often at all, that would pose a problem for "new" viewers.

The Program Association Table contains information about which programs are available within the stream. The Program Mapping Table contains the video/audio tracks per program. A single MPEG-TS stream can contain multiple programs and these in turn can contain multiple tracks. You will generally the all PMTs spread out over the stream at regular intervals.

  [Program Association Table]
Pointer Field: 0
Table ID: 0
Sectionlen: 13
Transport Stream ID: 0
Version Number: 0
Current/Next Indicator: 1
Section number: 0
Last Section number: 0
Programs [1]
[1] Program Number: 1, Program Map PID: 480
CRC32: 76F1A4CE
[PID 480|0: 184b PMT] [Start]
[Program Mapping Table]
Pointer Field: 0
Table ID: 2
Section Length: 61
Program number: 1
Version number: 0
Current next indicator: 1
Section number: 0
Last Section number: 0
PCR PID: 481
Program Info (0):
Stream 481: HEVC video (36)
Undecoded descriptor: 380D0220000000900000000000991F
Undecoded descriptor: 3F0F037F7F0000EA60019BFCC0000003E9
Stream 482: ADTS audio (15)
Language: und
CRC32: 37F96972

What you will often encounter with .ts format streams is that the video "starts" and after a few seconds the video/audio suddenly appears. This will be the lack of PAT/PMT information at the start of the .ts file. Most likely it has been made simply by recording in the middle of these information points instead of at the start of one. Any stream data before such a point should be considered lost and unrecoverable.

Presentation Time Stamp (PTS) / Decode Time Stamp (DTS)

Within the Analyser output you will encounter the tracks in Packetized Elementary Stream (PES) formats. This is how you can discriminate between tracks. Important is that with these PES any of the PTS/DTS timing in the stream is shown.

[PES 482] [Audio 0] [Aligned] [Copy] [PTS 0.933s] [Size 31] [Payload 17]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 0.955s] [Size 31] [Payload 17]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 0.976s] [Size 386] [Payload 372]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 0.997s] [Size 263] [Payload 249]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 1.019s] [Size 216] [Payload 202]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 1.040s] [Size 193] [Payload 179]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 1.061s] [Size 204] [Payload 190]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 1.083s] [Size 177] [Payload 163]
[PES 481] [Video 0] [Aligned] [Copy] [PTS 1.751s] [DTS 1.667s] [Size 6 => 330621] [Payload 330602]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 1.104s] [Size 189] [Payload 175]
[PES 481] [Video 0] [Aligned] [Copy] [PTS 1.717s] [DTS 1.684s] [Size 6 => 17249] [Payload 17230]
[PES 481] [Video 0] [Aligned] [Copy] [PTS 1.701s] [Size 6 => 7586] [Payload 7572]
[PES 481] [Video 0] [Aligned] [Copy] [PTS 1.734s] [DTS 1.717s] [Size 6 => 4493] [Payload 4474]
[PES 482] [Audio 0] [Aligned] [Copy] [PTS 1.125s] [Size 196] [Payload 182]

Now this could be interesting information, but you do have to know how PTS (Presentation Time Stamp) and DTS (Decoding Time Stamp) work. Some easy to follow guidelines without need of knowledge would be:

  • The PTS (Presentation Time Stamp) is the time that a frame should be presented to the viewer (display order).
  • The DTS (Decoding Time Stamp) is the time that a frame should be presented to the decoder (decode order).
  • Since Decode must happen before display, PTS should strictly be greater than or equal to DTS for any given frame.
  • If there is no separate DTS, this means the DTS and PTS are equal for that frame
  • If separate DTS are present, this means B-frames are present.
  • DTS must be strictly monotonically increasing e.g. it must go up by 1 second per second and never go down per track XXX.
  • MistServers output enforces each PES contains a single frame and is always Aligned. Other data sources may not do the same, this is not necessarily a problem.
  • PES XXX means it's data for track XXX.
  • Bursts of huge payloads could indicate a surge in bitrate & potential problem.
  • Audio generally has small payloads/sizes so will come by more often than video.