[FFmpeg-devel] How ffplay resolves bad timestamps?

Stas Oskin stas.oskin
Thu Dec 9 19:20:25 CET 2010


I'm trying to understand the exact mechanism that allow ffplay to
successfully play RTSP url, while ffmpeg fails with "non monotone
timestamps" time-stamp.

This happens due to media source sending several first packets with NOPTS
timestamps, which get corrected in middle between the 1st and 2nd
key-frames, thus breaking ffmpeg parsing.

In my own code, I mitigated this by simply ignoring everything up to the 2nd
key-frame, which is not optimal.
I tried to extrapolate backwards the normal timestamps, over the NOPTS
frames, but got broken video which again becomes normal only after 2nd

On another hand, ffplay can display the video pretty normally starting from
the first key-frame, so I wonder how it exactly does it.

Any idea what part of ffplay.c I should look to get the idea?


More information about the ffmpeg-devel mailing list