[Live-devel] Correct Timestamps in RTP-Packets

Ross Finlayson finlayson at live.com
Fri Jun 4 07:04:19 PDT 2004


>The RTP timestamps however should be well ordered.

Usually, but not always.  For example, if you're streaming a MPEG file that 
contains 'B' frames, then the frames' presentation times - and thus their 
corresponding RTP timestamps - will not be monotonically increasing.  (See 
RFC 2250, section 3.3.)

>Are you computing the correct RTP timestamps out of the presentation
>timestamps?

Yes, the RTP timestamps on outgoing packets are computed automatically from 
the corresponding presentation time.  (See 
"RTPSink::convertToRTPTimestamp()", which does this.)  So, all you need to 
do is feed your RTPSink object(s) correct presentation times.

>We created an object called BufferedSource which is derived from
>FramedSource. There we set the presentation timestamp to that timestamp
>we received from the mpeg2-file.

But apparently you're not doing this correctly.  That's why I suggest that 
you feed each of your sources into a corresponding 'framer' object 
("MPEG1or2AudioStreamFramer" and "MPEG1or2VideoStreamFramer") before 
feeding them to their 'RTPSink' objects.  The 'framer' objects add some 
overhead (to parse the MPEG headers), but will produce correct presentation 
times.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list