Relationship between I, P, B frames and PTS and DTS

Source: Internet
Author: User

Basic concepts:

I frame: the intra-frame encoding frame is also called intra picture. I frame is usually the first frame of each GOP (a video compression technology used by MPEG) and is moderately compressed, as a reference point for random access, it can be used as an image. I frame can be seen as a product after an image is compressed.

P frame: the Forward prediction Encoding Frame, also known as predictive-FrameBy fully compressing the time redundancy information lower than the previously encoded frames in the image sequence, the encoded images that transmit the data volume are also called prediction frames;

B frame: bidirectional prediction interpolation Encoding Frame, also known as bi-directional interpolated prediction frame, not only considers the encoded frame prior to the source image sequence, the time redundancy information between encoded frames after the source image sequence is also taken into account to compress the encoded images that transmit data volumes, also known as bidirectional prediction frames;

PTS: presentation time stamp. PTS is used to measure when decoded video frames are displayed.

DTS: Decode time stamp. DTS mainly identifies when the bit stream in the memory is read into the decoder for decoding.

The sequence of DTs and PTS should be the same without B frames.

Different IPB frames:

I frame: You can decompress the image into a complete image by using the video decompression algorithm.

P frame: refer to an I frame or B frame to generate a complete image.

B frame: refer to the previous I or P frame and the next P frame to generate a complete image.

A GOP is formed between two I frames. In x264, The BF size can be set through parameters, that is, the number of B between I and P or two p.

Based on the above, it can be indicated that if B frame exists, the last frame of GoP must be p.

Difference between DTs and PTS:

DTS is mainly used for video decoding and is used in the decoding phase. PTS is mainly used for Video Synchronization and output. used in display. without B frame. the output sequence of DTs and PTS is the same.

Example:

The following is an example of a GOP of 15. The decoded frame and its decoding sequence are all in it:

For example, I frame decoding does not depend on any other frames. the decoding of P frame depends on the I frame or P frame above it. the decoding of B frame depends on the nearest I frame or P frame and the nearest P frame.

 

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.