Audio and Video Column-DTS&PTS

First, many people on the Internet are talking about dts and pts, but how many people have explained this issue clearly, and even many people who have done audio and video development for many years can't figure it out. Today I will sort out the schematic diagram Next, learn with everyone, if you have any questions, welcome to criticize and correct

Then let's explain these two concepts first.

  • DTS (Decoding Time Stamp): It is the decoding time stamp. The meaning of this time stamp is to tell the player when to decode the data of this frame.
  • PTS (Presentation Time Stamp): Displays the timestamp, which is used to tell the player when to display the data of this frame
  • GOP: A video compression technique used by (Group of Picture) MPEG

Although DTS and PTS are used to guide the behavior of the player, they are generated by the encoder during encoding.

During video capture, one frame is recorded and one frame is encoded and one frame is sent. PTS will be generated during encoding. Here, special attention should be paid to the encoding method of frame. In normal scenarios, codec encoding An I frame, then skip forward a few frames, encode a future P frame using the encoded I frame as a reference frame, and then jump back to the next frame after the I frame. Frames between encoded I-frames and P-frames are encoded as B-frames. The encoder then skips a few frames again, encodes another P frame using the first P frame as a base frame, and then jumps back again to fill the gaps in the display sequence with B frames. This process continues continuously, inserting a new I frame within every 12 to 15 P and B frames. A P frame is preceded by a previous I frame or P

Guess you like

Origin blog.csdn.net/qq_18757557/article/details/130927774