In the first part of our transport stream related articles we look closer on PAT - Program Association Table.
Program Association Table is one of program-specific information (PSI) tables in MPEG transport stream. It matches Service Identificator PID and Program Map Table PID numbers with each service located in the stream. The PAT should end with a 32-bit CRC.
PAT is assigned to PID "0" and is repeated very frequently, because of its importance.
TV & Engineering: PAT
Basics of transport stream elements: Program Association Table.
How to parse a PAT table?
Then PMT data appears and is repeated N times depending on section length.
When all data is sent CRC section finishes the frame.
In our example we used the PMT stream of Skylogic multiplex (Eutelsat 9A - 9°E, 11747 MHz, pol. H, SR 27500, FEC 3/4, DVB-S/QPSK). In this multiplex Trace HD channels and some Italian radio channels are broadcast.
In our first graphic we skipped zero bytes that indicates PAT table. Section lenght is stored on 10 bits. In the example section lenght is 61 bytes. Then TSID numer follows (TSID = 1), table number is 0 and current/next is set to "true".
Section number is "0" and last section is also "0".
Then PMT loop starts. First two bytes are SID number (in our picture we skipped first zero byte), then reserved "111" follows. Next 13 bits are binary representation of PMT PID number. When SID is set to "0" it usually points to PMT PID "16", which is NIT table.
Then we got SIDs and PMTs of all services in transport stream.
Full parsing will give us these PIDs:
and others (not shown in our graphic example):
When loop ends CRC Section bytes appears.
Section CRC: 65 6C F5 BF
As we can see all bytes until the end are set to "FF" - nullbytes. It is because TS frame is 188 bytes long, and this information is stored on less than 188 bytes. To make it regular length redundant nullbytes are added.