[FFmpeg-devel] PTS for H.264 in MPEG-TS: should be delayed?

Nicolas George nicolas.george at normalesup.org
Tue Aug 21 17:33:29 CEST 2012

I am trying to analyze the files in this:


When reading the MPEG-TS files pointed by it, lavf gives a lot of warnings:

[mpegts @ 0x1b743c0] Invalid timestamps stream=1, pts=903000, dts=906000, size=709

If I dump things straight from the file, I get:

st=1 dts=900000 pts=900000  (P?)
st=1 dts=903000 pts=906000  (I?)
st=1 dts=906000 pts=903000  (B?)
st=1 dts=909000 pts=912000  (I?)
st=1 dts=912000 pts=909000  (B?)
st=1 dts=915000 pts=918000  (I?)
st=1 dts=918000 pts=915000  (B?)
st=1 dts=921000 pts=924000  (I?)
st=1 dts=924000 pts=921000  (B?)

(I added the frame type by hand, by matching with the decoded frames and

Obviously, the PTS are wrong, since for B-frames there is PTS < DTS.

If I were to add one frame delay to all PTS values, then everything becomes
valid and logic. Are these files invalid, or is the MPEG-TS demuxer
forgetting to add the delay to the PTS value?

Note: when the decoder is inited, it has delay=4 and ticks_per_frame=2.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120821/553f20b0/attachment.asc>

More information about the ffmpeg-devel mailing list