TS Popular Science 2 Baotou

Source: Internet
Author: User

TS streams are fixed 188-byte packets of equal length



As shown in the following figure, a TS stream opened with UltraEdit, we found a 47 per 188 byte (can be considered as a header)


TS header takes up to four bytes

Take the first package as an example:

B0 0D E0 (C1) at the same
Bayi 0C 8C be ff ff ... ..... ..... ....... ...... ....... ...
...............................................................
...............................................................
... FF---------------------???.

We divide it by bit (0~31 bit, total 4 bytes, 32 bits)

1.0~7 bit: Sync position first byte such as hexadecimal 47 (01000111)

2.8~10   bit: 9th is the payload cell start: (1 indicates that the start character 0 represents subsequent data) a TS packet is 188 bytes   and a frame of data is far greater than 188 bytes   So a frame of data is split into multiple TS packets.
                              1 indicates the frame's The first TS package contains the description of the current frame PTS (presentation time
                                     stamp) indicates the time position of the frame data and the amount of data in the current frame (TS packet count, most of which do not describe
  &NBSP ;                                   &NB Sp with 0 instead)
                              0 t S Package   Store the remaining information for the current frame
                          Only one of the three hexadecimal digits appears: 0 4 6, other description package error     If currently 6

0: Binary 0000 (Payload Unit starter 0) Here, a PID is borrowed.
4: Binary 0100 (Payload Unit starter 1) Here, a PID is borrowed.
6: Binary 0110 (Payload Unit starter 1) Here, a PID is borrowed.

3.11~23 bit: PID (packet ID) is the unique identifier for each program, such as 0 0 0 (the first package is 000) (except for pid=000 the first package other numbers are randomly selectable without having to be sorted by some sort of sequence)

4.24~27 bit: Four bits just can use a 16 digital ID to indicate that its payload type (which holds valid data) is currently 1 to indicate that the payload is only payload
0: Reserved value for future use (encounter discarded)
1: Only payloads in the load
2: Only adaptive fields in the load
3: The first adaptive field, and then a payload

Adaptive field length, up to one byte
Adaptive field content, the byte is determined by the length adaptive field length, the extra byte is filled with 0xFF

5.28~31 bit: Do not need to consider directly skip the simple understanding of the same PID sequence code



pes (packetized Elementary Stream) packaged meta-flow simply say one PES packet remove PES header the rest is a frame of data

A TS package with a payload unit starting at 1 will contain part of the PES header



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.