[Live-devel] RTP Timestamp to UTC time
mohita gandotra
mohitagandotra at gmail.com
Sat May 29 06:05:23 PDT 2010
Hi Ross
I am not a casual hobbiest.I am using gmail id because My Official mail-id
is not accessible from home. I access Live555 mails from home also. But if
you want I will subscribe to the live555 mailing list using my official id.
I have more queries regarding timestamp. I don't understand the code
in RTPReceptionStats::noteIncomingSR
function. The function is written as:
void RTPReceptionStats::noteIncomingSR(u_int32_t ntpTimestampMSW,
u_int32_t
ntpTimestampLSW,
u_int32_t
rtpTimestamp) {
fLastReceivedSR_NTPmsw = ntpTimestampMSW;
fLastReceivedSR_NTPlsw = ntpTimestampLSW;
gettimeofday(&fLastReceivedSR_time, NULL);
// Use this SR to update time synchronization information:
fSyncTimestamp = rtpTimestamp;
fSyncTime.tv_sec = ntpTimestampMSW - 0x83AA7E80; // 1/1/1900 -> 1/1/1970
double microseconds = (ntpTimestampLSW*15625.0)/0x04000000; // 10^6/2^32
fSyncTime.tv_usec = (unsigned)(microseconds+0.5);
fHasBeenSynchronized = True;
}
I having following confusion:
1. fSyncTime.tv_sec = ntpTimestampMSW - 0x83AA7E80; // 1/1/1900 -> 1/1/1970
why 0x83AA7E80 is subtracted from ntpTimestampMSW?
2. double microseconds = (ntpTimestampLSW*15625.0)/0x04000000; // 10^6/2^32
Why 15625.0 is multiplied with ntpTimestampLSW and the result is divided by
0x04000000
Please reply.
On Mon, May 10, 2010 at 10:34 AM, Ross Finlayson <finlayson at live555.com>wrote:
> We are developing a client application using Live555.
>>
>
> Do "we" not have a domain name? (If you use a "@gmail.com" email address,
> then you are assumed to be a casual hobbiest (whose posts are moderated and
> given a very low-priority), not a "we".)
>
>
>
> Our application have some specific requirement of converting the rtp
>> timestamp of each video frame to utc time. So I have following query
>> regarding this:
>>
>> 1.The MediaSink class of Live555 gets the presentation time as a parameter
>> in aftergettingframe function.This presentation time can be converted to RTP
>> timestamp using convertToRTPTimestamp function in RTPSink class.I just want
>> to know how this rtp timestamp can be converted to UTC time.
>>
>
> You don't need to know or care about RTP timestamps. Our software
> automatically converts from presentation time to RTP timestamp (at the
> server end), and then back from RTP timestamp to presentation time (at the
> client end). This is assuming, of course, that you use RTCP (which is a
> required part of the RTP/RTCP standard).
>
> So, just make sure that you give your streams proper presentation times at
> the server end - and you will get them automatically at the client end.
> These presentation times must be aligned with 'wall clock' time - i.e., the
> time that you would get by calling "gettimeofday()". (If "gettimeofday()"
> does not return UTC time, then you will need to apply the appropriate
> conversion at the client end.
> --
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
--
Mohita Gandotra
------------------------------
Senior Software Engineer
Canon India Pvt. Ltd., Noida
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100529/3b5c6683/attachment.html>
More information about the live-devel
mailing list