[FFmpeg-devel] How ffplay resolves bad timestamps?

Martin Storsjö martin
Wed Dec 22 23:37:17 CET 2010

On Thu, 23 Dec 2010, Stas Oskin wrote:

> > Ok, that's good to hear. On the other hand, for streams without 
> > RTP-Info, I guess one can use the timestamp/sequence number of the 
> > first packet of each stream to avoid having too many codepaths/special 
> > cases.
> >
> You mean the first packet with good (non-NOPTS) time-stamp?

No - I meant within rtpdec. All RTP packets have timestamps, but we can 
only sync them properly when we've got RTCP packets - that's why we 
currently return packets without timestamps up to that point. If we get 
the RTP-Info header, we can use that as reference point to sync all the 
streams together until we get the first RTCP packet. And if we don't get 
RTP-Info either, we could just pretend that we got a RTP-Info packet, 
saying that the first RTP packet we received was the one specified. That 
is, all streams would start off at ts=0, and be resynced properly when we 
get the first RTCP. In one sense, that would be better than not emitting 
timestamps at all for those packets.

// Martin

More information about the ffmpeg-devel mailing list