MPEG-TS (Transport Stream) - is a transport format for transmission video, audio, and other data over IP or broadband networks. Detailed description available in the ISO 13818-1 standard.
Elementary Stream (ES) is a compressed data output from the encoder.
Packetized Elementary Stream (PES) is a sequence of the headers with ES information and the ES frames. Multiplexing is an operation of the packetizing several elementary streams into single stream. Demultiplexing is the reverse process of multiplexing. Demultiplexing single stream into separate components and pass components to processing.
Program-specific information (PSI) is a packets with information about stream for receiver to demultiplex and decode streams of program.
In addition to the PSI, data is needed to provide identification of services and events for the user:
Transport Stream is a sequence of the TS packets. TS packets have fixed length in 188 bytes. First byte, also called the sync byte, is always 0x47. Next 3 bytes is a header. Remain 184 bytes is a payload (PES, PSI, or SI packets).
TS Header contains next information:
Elementary streams (video, audio) and information tables are packed to the TS-packets. Each packet has unique identifier - PID. The PID value must be between 0 and 8191. The range 0 to 31 and 8191 is reserved and should not be used. You can use any PID in the range from 32 to 8190.