Brief introduction of MPEG2/TS package structure

Source: Internet
Author: User
Tags reserved

The TS package consists of the following 3 parts:

Baotou: 4 bytes, synchronization, identification, error detection and encryption

Self-adapting domain: Optional

Package data: Maximum 184 bytes (no adaptive domain exists)

4 bytes

184 bytes

Baotou

Self-adapting domain

Package data

4-byte Baotou structure:

1 bytes

1 bits

1 bits

1 bits

13 Bits

2 bits

2 bits

4 bits

Synchronization bytes

Transmission Error Descriptor

Load Start descriptor

Transfer priority

Packet recognition

Transmission scrambling control

Adaptive domain Control

Continuous counter

The self-adapting domain structure contains:

Domain Length: 1 bytes

Domain flag: 1 bytes, PCR flag is one of the important signs

Domain Information: specified by domain length

the types of package data are generally as follows:

PSI Information: Pat/pmt/cat/nit table

Video streaming

Audio streaming

Subtitle Stream

In addition to PSI information, video streaming, audio streaming, and subtitle streaming will do pes packaging.

PAT Table Structure

The Complete Pat table contains a header structure and several program structures,

Finally, a CRC check is added.

PAT Header structure (total 8 bytes)

1Byte

1bit

1bit

2bit

12bit

2Byte

2bit

5bit

1bit

1Byte

1Byte

Table identification

Segment Syntax identifiers

Fill 0

Keep

Segment length with CRC

Transport Stream Identity

Keep

Version number

Effective identification

Segment number

Last Paragraph number

Pat Table Program Structure

2Byte

3bit

13bit

Program number

Keep

Program Mapping Table PID

PMT Table Structure

A complete PMT table contains a table header and several flow structures,

Finally, a CRC check is added.

PMT Table Flow Structure

1Byte

3bit

13bit

4bit

12bit

Flow type

Keep

Basic Element PID

Keep

Program element length

PMT Header structure (total 12 bytes)

1Byte

1bit

1bit

2bit

12bit

2Byte

2bit

5bit

1bit

1Byte

1Byte

3bit

13bit

4bit

12bit

Table identification

Segment Syntax identifier

Fill 0

Reserved

Segment length incl. CRC

Number of programs

Reserved

Version

Valid identity

Segment number

Last paragraph number

Reserved

PCR PID

  Keep

Program information length

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.