I-frames, p-frames, B-frames, PTS, DTS (i)

Source: Internet
Author: User

Do video playback, involving key frame one said, when the data from the video stream to display the image, what is the correlation between these images? Then it is necessary to understand the concept of I-frame, P-frame, B-frame, PTS, and DTS, the relationship between i,p,b frame and Pts,dts is explained as follows:

Basic concepts:

 I Frame: Intra-frame encoding frame also known as intra picture,i frame is usually the first frame of each GOP (a video compression technique used by MPEG), which is moderately compressed as a reference point for random access and can be used as an image. I-frames can be seen as a product of a compressed image.

P Frame: Forward prediction coding frame, also known aspredictive-frame, by sufficiently lower than the image sequence of the previously encoded frame of time redundancy information to compress the amount of transmitted data encoded image, called the prediction frame;

B frame: Bidirectional prediction interpolation coding frame also known as bi-directional interpolated prediction frame, both considering with the source image sequence before the encoded frame, It also takes into account the time redundancy information between the encoded frames behind the source image sequence to compress the encoded image of the transmitted data, also called the bidirectional prediction frame;

Pts:presentation time Stamp. PTS are primarily used to measure when a decoded video frame is displayed.

Dts:decode time Stamp. DTS primarily identifies when the bit stream in memory is read into the decoder to decode.

The order of DTS and the order of PTS should be the same without the existence of B-frames.

IPB frames are different:

  I frame: itself can be extracted by the video decompression algorithm into a single complete picture.

P frame: You need to refer to an I frame or b frame in front of it to generate a complete picture.

B frame: Refer to its previous I or P frame and a P-frame behind it to generate a complete picture.

A GOP is formed between two I frames, and the size of the BF can be set by parameter in x264, i.e. the number of B between I and P or two p.

The above-mentioned basic can be explained that if a B frame exists, the last frame of a GOP must be p.

Different for DTS and pts:

DTS is primarily used for decoding video, which is used in the decoding phase. PTS are primarily used for video synchronization and output. Used when display. In the absence of a B frame. The output order of DTS and PTS is the same.

Example:

Here is an example of a GOP of 15, with its decoded reference frame and its decoding sequence in it:

such as: I-frame decoding does not depend on any other frames. The decoding of P frame depends on the I frame or p frame in front of it. The decoding of frame B depends on the nearest I-frame or P-frame and the nearest P-frame in front of it.

  

Learn any new things need to have their own cognition and summary, when not yet have this ability, it is necessary to see other people's summary. Very like the people who have the ability, can be in front of me very drag, but those water people in the proud of showing off, my heart thousands grass mud horse in the Pentium. Take a look at the Zhejiang University of Baidu, a computer female master's degree in the postgraduate period on I-frame, B-frame, p-frame understanding, what is I-frame, p-frame, B-frame. Specific content, click the link to see.

I-frames, p-frames, B-frames, PTS, DTS (i)

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.