[Libav-user] Help to understand PTS, DTS, timebase

Carl Eugen Hoyos ceffmpeg at gmail.com
Tue Nov 14 02:11:13 EET 2017

2017-11-14 0:07 GMT+01:00 Leandro Moreira <leandro.ribeiro.moreira at gmail.com>:

> PTS 0 1 2 3 (when it needs to be present, order)
> DTS 0 3 1 1(when it needs to be decoded)

This is either wrong or misleading (or both):
Every frame needs its own dts and dts cannot
be equal for different frames.

> (can be different due to B frames
> and their need to know the future beforehand)
> PTS_TIME FRAME_N x TIMEBASE (when it needs to be played, a value that we can
> use in some sorta way into seconds)

> First of all, I assume that this information about when you will play a
> frame nth is in the container, not on the codec, right?

As such, this is definitely not correct, raw H.264 streams do
produce timestamps (that unfortunately can be wrong with

Carl Eugen

More information about the Libav-user mailing list