RTCP Sender Report and RTP timestamp calculation

56 views Asked by At

An RTCP Sender Report (SR) has RTP and NTP timestamps and from my understanding, both timestamps indicate the same point in time, that is the time of the generation of the SR, but in different units : NTP timestamps format (in seconds and fraction of seconds) and RTP timeline (in number of samples).

When the RCTP SR needs to be generated, the NTP timestamp is easy to compute (current wall clock time in NTP format) but what about the RTP timestamp ?

From https://www.csperkins.org/standards/rtp-book.html (chapter 7, figure 7.2), i can see that there is a relation between RTP and NTP timestamp for a given media stream :

Trtp = Tref * R + O

with R being the sampling frequency, O an offset and Tref the wall clock time of the SR generation.

R is known by the sender but O should be computed dynamically with the formula :

O = Trtp - (Tavail - Dcapture) * R

with Tavail, the time at which the frame is ready (all samples have been processed) and Dcapture, the delay between the first sample and Tavail, both in wall clock time (i might be wrong here)

Can someone give more explanations of the logic behind these formulas ? I don't really understand why O is calculated like that especially and what it represent.

Thank you.

0

There are 0 answers