Subject: NTP and RTP Timestamps

From: Rafiq Shaikh <[email-masked]>
Date: Wed, 18 Aug 1999 13:05:15 +0530 (IST)

Hi all,

Can anyone help me understand how to calculate the NTP and RTP 
timestamps.
Any clarification or pointers will be appreciable.

Thanks in advance.

Regards,
-Rafiq.

---

From: Colin Perkins <[email-masked]>
Date: Wed, 18 Aug 1999 11:52:03 +0100

>Any clarification or pointers will be appreciable.

The RTP timestamp starts at a random value, and increases at the rate of
the media clock. For example, if one is sending 8kHz PCMU audio in 20ms
packets, the RTP timestamp will increase by 160 with each data packet.

The NTP timestamp is the time in seconds since 1 January 1900. On a Unix,
system you can derive this by adding 2208988800u to the time returned by
gettimeofday(), for example. 

Since both increase linearly, its a simple matter to map from one clock to
the other. The timestamps in SR packets relate to the time at which the SR
is sent: the NTP time is directly measured (eg: by calling gettimeofday())
and the equivalent RTP timestamp is derived from that.

Does this help?

Colin

---

From: Rafiq Shaikh <[email-masked]>
Date: Thu, 19 Aug 1999 10:04:27 +0530

Hi Colin,

Yes! Thanks for the help.

Regards,
-Rafiq.