[Live-devel] RTP timestamp

Ross Finlayson finlayson at live555.com
Tue Jul 4 08:45:40 PDT 2006


>My code on server side looks like:
>
>void MyFileSource::incomingPacketHandler1() {
>// Getting jpeg frame  from archive
>// Getting its timestamp
>// Assigning this timestamp to "fPresentationTime"
>fPresentationTime = currentFrameTimestamp;
>
>// Delivering frame to client, calling "afterGetting"
>}
>Is there any wrong?

Yes - you didn't read my previous email.

You can't just set "fPresentationTime" to 
"currentFrameTimestamp".  Instead, you must first add or subtract an 
offset so that it is aligned with 'wall clock time'.

I.e., for the first timestamp (in pseudo code):
         gettimeofday(&timeNow, NULL)
         offset = timeNow - currentFrameTimestamp;
         fPresentationTime = timeNow;

For the second and subsequent timestamps:
         fPresentationTime = currentFrameTimestamp - offset;


	Ross Finlayson
	Live Networks, Inc. (LIVE555.COM)
	<http://www.live555.com/>



More information about the live-devel mailing list