Program-specific information (PSI) is metadata about a program (channel) and part of an MPEG transport stream.
The PSI data as defined by ISO/IEC 13818-1 (MPEG-2 Part 1: Systems) includes four tables: PAT (Program Association Table) CAT (Conditional Access Table) PMT (Program Mapping Table) NIT (Network Information Table) The MPEG-2 specification does not specify the format of the CAT and NIT.
PSI is carried in the form of a table structure. Each table structure is broken into sections, although some tables like a PMT cannot have more than one section. Each section can span multiple transport stream packets. On the other hand, although this is uncommon, a transport stream packet or set of packets under the same PID can contain multiple sections belonging to different tables. Adaptation field also occurs in TS packets carrying PSI data. The PSI data will never be scrambled so that the decoder at the receiving end can easily identify the properties of the stream.
The sections comprising the PAT and CAT tables are associated with predefined PIDs (Packet Identifier) and table IDs as explained in their respective descriptions below. There may be multiple independent PMTs in a stream, one for each program. Each PMT is given a unique user-defined PID and maps a program number to the metadata describing that program and the streams within it. PMT PIDs are defined in the PAT, and are the only PIDs defined there. The streams themselves are contained in PES packets with user-defined PIDs specified in the PMT.
PSI structure
Table Sections + Pointerhttp://www.iso.org/iso/catalogue_detail?csnumber=44169 ISO/IEC 13818-1 Information technology --- Generic coding of moving pictures and associated audio information: Systems (MPEG-2) http://www.jdsu.com/ProductLiterature/mpeg2_bk_cab_tm_ae.pdf(MPEG-2 Pocketguide) NameNumberof bitsDescription Pointer field8 Present at the start of the TS packet payload signaled by the payload_unit_start_indicator bit in the TS header. Used to set packet alignment bytes or content before the start of tabled payload data. Skipped bytes N*8 When the pointer field is non-zero, this is the pointer field number of skipped bytes (usually belonging to the previous table section spanning across TS packets). + Section headerNameNumberof bitsDescription Table ID 8 Table Identifier, that defines the structure of the syntax section and other contained data. As an exception, if this is the byte that immediately follow previous table section and is set to 0xFF, then it indicates that the repeat of table section end here and the rest of TS packet payload shall be stuffed with 0xFF. Consequently, the value 0xFF shall not be used for the Table Identifier. Section syntax indicator 1 A flag that indicates if the long section header syntax is used (fields following Section Length are present). The PAT, PMT, and CAT all set this to 1. Private bit 1 The PAT, PMT, and CAT all set this to 0. Other tables set this to 1. Reserved bits 2 Set to 0x03 (all bits on) Section length unused bits 2 Set to 0 (all bits off) Section length 10 The number of bytes that follow, including long header, data, and CRC value. Must be <=1021 for PAT, CAT, and PMT, but can be 4093 for private sections and some others. + Section long header (present if section syntax indicator is 1)NameNumberof bitsDescription Table ID extension 16 Supplemental identifier. The PAT uses this for the transport stream identifier and the PMT uses this for the Program number. Reserved bits 2 Set to 0x03 (all bits on) Version number 5 Table version number. Incremented when data is changed and wrapped around on overflow for values greater than 32. Current/next indicator 1 Indicates if data is currently in effect or will be made effective in the near future. If the bit is 1, the data is to be used now. If 0, the decoder may begin to prepare for the data to change. Section number 8 This is the index of the section within its table. The first section starts from 0. Last section number 8 This indicates the total number of sections in the table, minus 1. + Section data and checksumNameNumberof bitsDescription Section data N*8 Data as defined by the Table Identifier. CRC-32 32 A checksum of the entire section excluding the pointer field, pointer filler bytes and the trailing CRC-32.
Descriptor + DescriptorNameNumberof bitsDescription descriptor tag8 the tag defines the structure of the contained data following the descriptor length. descriptor length 8 The number of bytes that are to follow. Descriptor data N*8 Data as defined by the Descriptor Tag.
PAT (Program Association Table) The program association table (PAT) lists all programs available in the transport stream. Each of the listed programs is identified by a 16-bit value called program_number. Each of the programs listed in PAT has an associated value of PID for its PMT.
The value 0x0000 for program_number is reserved to specify the PID where to look for network information table. If such a program is not present in PAT the default PID value (0x0010) shall be used for NIT.
TS packets containing PAT information always have PID 0x0000.
+ PAT specific data repeated until end of section lengthNameNumberof bitsDescription Program num 16 Relates to the Table ID extension in the associated PMT. A value of 0 is reserved for a NIT packet identifier. Reserved bits 3 Set to 0x07 (all bits on) Program map PID 13 The packet identifier that contains the associated PMT
The PAT is assigned PID 0x0000 and table id of 0x00. The transport stream contains at least one or more TS packets with PID 0x0000. Some of these consecutive packets form the PAT. At the decoder side the PSI section filter listens to the incoming TS packets. After the filter identifies the PAT table they assemble the packet and decode it. A PAT has information about all the programs contained in the TS. The PAT contains information showing the association of Program Map Table PID and Program Number. The PAT should end with a 32-bit CRC
PMT (Program map specific data) PMTs contain information about programs. For each program, there is one PMT. While the MPEG-2 standard permits more than one PMT section to be transmitted on a single PID (Single Transport stream PID contains PMT information of more than one program), most MPEG-2 "users" such as ATSC and SCTE require each PMT to be transmitted on a separate PID that is not used for any other packets. The PMTs provide information on each program present in the transport stream, including the program_number, and list the elementary streams that comprise the described MPEG-2 program. There are also locations for optional descriptors that describe the entire MPEG-2 program, as well as an optional descriptor for each elementary stream. Each elementary stream is labeled with a stream_type value.
+ PMT specific dataNameNumberof bitsDescription Reserved bits 3 Set to 0x07 (all bits on) PCR PID 13 The packet identifier that contains the program clock reference used to improve the random access accuracy of the stream's timing that is derived from the program timestamp. If this is unused. then it is set to 0x1FFF (all bits on). Reserved bits 4 Set to 0x0F (all bits on) Program info length unused bits 2 Set to 0 (all bits off) Program info length 10 The number of bytes that follow for the program descriptors. Program descriptors N*8 When the program info length is non-zero, this is the program info length number of program descriptor bytes. Elementary stream info data N*8 The streams used in this program map.
+ Elementary stream specific data repeated until end of section lengthNameNumberof bitsDescription stream type 8 This defines the structure of the data contained within the elementary packet identifier. Reserved bits 3 Set to 0x07 (all bits on) Elementary PID 13 The packet identifier that contains the stream type data. Reserved bits 4 Set to 0x0F (all bits on) ES Info length unused bits 2 Set to 0 (all bits off) ES Info length 10 The number of bytes that follow for the elementary stream descriptors. Elementary stream descriptors N*8 When the ES info length is non-zero, this is the ES info length number of elementary stream descriptor bytes. This table contains PID numbers of elementary streams associated with the program and it has information about the type of these elementary streams (video, audio, etc.). In addition it may also contain an ECM (entitlement control messages) stream for any other stream that is encrypted. These messages provide the information used in the cipher key selection stage.
CAT (Conditional access specific data) Table ID value is 0x01.
This table is used for conditional access management of the cypher keys used for decryption of restricted streams. This table contains privately defined descriptors of the system used and the associated EMM PID. It is used by a network provider to maintain regular key updates.
NIT (Network information specific data) This optional table may group transport stream identifiers into a network, providing access parameters and other details. ITU-T Rec. H.222 and ISO/IEC 13818-1 do not define the NIT structure. The European Broadcasting Union DVB specification ETSI EN 300 468 (DVB-SI)ETSI-EN 300 468 Digital Video Broadcasting (DVB); Specification for Service Information (SI) in DVB systems does. The purpose of mentioning but not defining this table in H.222 is that it has reserved program number 0 (zero) in the PAT. The Table ID extension is used to identify the local network together with a directory listing of transport streams. Descriptors are used to list the modulation, source of those streams and programs. The original network identifier is meant to allow transport streams and programs on foreign networks to be included in the local network which allows no remapping of transport and program IDs that may be duplicated between networks. The DVB specification defines the transport packet identifier as 16 and the table identifier of the local network of transports as 64. A table identifier of 65 is for a foreign network of transports. The network identifiers are maintained via DVB Services who have separated the identifiers into two unique, yet unnecessary groupings of Network_ID and Original_Network_ID. The two groupings have a large number of overlapping entries.
PSI labels
Table Identifiers Each table in a transport stream is identified by an 8-bit table identifier.
+ Identifiers in use Decimal Hexadecimal Description 0 0x00 Program Association section contains a directory listing of all Program Map Tables 1 0x01 Conditional Access section contains a directory listing of all EMM streams 2 0x02 Program Map section contains a directory listing of all elementary streams. 3 0x03 Transport Stream Description section. 4 0x04 ISO/IEC 14496 scene description section. 5 0x05 ISO/IEC 14496 object description section. 6 0x06 Metadata section. 7 0x07 ISO/IEC 13818-11 IPMP control information (DRM). 8 - 57 0x08 - 0x39 Reserved. 58 0x3A ISO/IEC 13818-6 DSM CC multiprotocol encapsulated. 59 0x3B ISO/IEC 13818-6 DSM CC U-N messages. 60 0x3C ISO/IEC 13818-6 DSM CC Download Data Messages. 61 0x3D ISO/IEC 13818-6 DSM CC stream descriptor list. 62 0x3E ISO/IEC 13818-6 DSM CC privately defined (used by DVB MAC addressed datagrams). 63 0x3F ISO/IEC 13818-6 DSM CC addressable. 64 - 127 0x40 - 0x7F Used by DVB. 128 - 143 0x80 - 0x8F DVB-CSA and DigiCipher II/ATSC CA message sections used in EMM and ECM streams. 144 - 191 0x90 - 0xBF May be assigned as needed to other data tables. 192 - 254 0xC0 - 0xFE Used by DigiCipher II/ATSC/SCTE. 255 0xFF Forbidden. As is used for null padding. SCTE Specific tables: 0xCO table id is used by Programme Information Message 0xC1 table id is used by Programme Name Message It is not necessary that pid of PMT pointed by PAT will contain a table with table id 0x02 Ignoring table id while reading PMT could have bad consequence
Program and Elementary Stream Descriptor Tags