The preceding three sections summarize the basic formats of MPEG2 ts, including PES, PS, ts, and related fields. As a transmission stream, TS will package and reuse the content, convert the media content into ts for transmission, and finally decode the content on the decoding end. To put it simply, ts is a transport layer protocol stack that supports transmission of various content, such as MPEG, WMV, h264, and even IP addresses, how is the transmission specification defined? This is what PSI (Program-specific information) is about to do.
PSI consists of four tables: Pat, PMT, cat, and NIT, which respectively describe the Transmission Structure of all es streams included in a TS. The first concept is that ts is transmitted in the form of packets. The codec end must use a certain package ID to identify the content carried in the TS stream. For example, the Pat table exists in one or more ts packages, so it must be represented by a special package ID. In addition, different es streams also need different package IDs to identify. We have two tables, Pat and PMT, And the decoder can identify the TS packages from different es Based on the PID for decoding.
TS decoding is divided into two steps. The first step is from PID0 in the TS package, parse the Pat table, and find the PID of each program source from the Pat table. Generally, such programs are composed of several es streams and described in the PMT table, then, the PID of each es can be retrieved in the PMT table through the node source PID. Second, the decoder distinguishes the packages on the TS Stream Based on the es stream PID in the PMT table and decodes the packets based on different es streams. Therefore, ts is completed through two layers: program multiplexing and transmission multiplexing. That is, when the program is reused, PMT is added, and Pat is added during transmission reusage. Similarly, when the program is resolved, you can obtain the PMT and pat when the program is resolved. The idea is well outlined.
(To be continued)