Skip to content
Search

Presentation timestamp

lastmod 2024-05-24created 2022-10-117 edits

Timestamp for display order.

Used together with the Presentation Time Stamp (PTS) is the Deconding Time Stamp (DTS; timestamp for decoding order).

PTS vs DTS

Suppose we have a video, and the frames are displayed as follows.

I B B P

Now, we need to know the information in the P frame before we can display the B frames. Because of this, the frames will probably be stored as follows.

I P B B

This is why each frame needs both a DTS and a PTS. The DTS tells us when to decode, and the PTS tells us when to display. So in this case, our stream looks like this.

P T S: 1 4 2 3
D T S: 1 2 3 4
FRAME: I P B B

How PTS is calculated in FFmpeg

See AVPacket for details.

See also

Favorite site

author Zer0 sitemap