[FFmpeg-user] Some questions about PTS
Mark Filipak
markfilipak.windows+ffmpeg at gmail.com
Fri Aug 28 19:29:48 EEST 2020
The PTS value below: 000- 0000 0000 0000 000- 1000 1001 1000 111-, is for a particular case. It will
vary for other videos. I hope that didn't confuse you.
On 08/28/2020 03:51 AM, Michael Koch wrote:
> Hello all,
>
> please comment if the following is right or wrong:
>
> -- The timebase of a video (TB in setpts filter) is expressed in the unit [s] (seconds).
> -- The framerate of a video (FR in setpts filter) is expressed in the unit [s^-1] (1/seconds).
> -- In many cases the timebase is the reciprocal of the framerate, but this isn't always the case.
> -- If the timebase is the reciprocal of the framerate, a stream can be delayed by x frames using
> setpts=PTS+x
> -- In the more general case for arbitrary timebase and framerate, a stream can be delayed by x
> frames using setpts=PTS+x/(FR*TB)
I don't know enough yet to know whether this helps, but PTS in H.222 (ยง2.1.57) is: "A field that may
be present in a PES packet header that indicates the time that a presentation unit is presented in
the system target decoder." It's a 33 bit field in the PES HEADER EXTENSION, starting at bit 4,
[0000.4] PTS: ---- 000- 0000 0000 0000 000- 1000 1001 1000 111-
and must be divided by 90KHz in order to yield seconds. I've seen it solely in key frames.
I've computed PTS and the deltas between PTSs for several dozen professionally authored videos and
they do not correlate to frames, even for CFR video. H.222 presents a decoding model and PTS seems
to conform to that model, not to the frames in the stream. H.222 appears to be insufficiently
documented to resolve the discrepancy. It remains mysterious but I hope to eventually resolve it.
- Mark.
More information about the ffmpeg-user
mailing list