RTP - Lip Sync Part 1, RTCP Sender Report

This is a multi-series of RTP lip synchronization post. Lip synchronization is a very very tedious topic that requires you to understand multiple RTP concepts. So for part1, I will talk about RTCP sender report (SR)

The purpose of RTCP SR is to provide information on the media that had recently sent by the server.

See RFC 3550 6.4.1, it has a complete packet format for RTCP SR.



SR is identified by packet type of 200 in the PT field

The most important part of SR for lip sync is NTP timestamp field. The NTP timestamp is a 64 bits unsigned value that denote the time of the SR is sent. For the upper 32 bits (MSW), it denotes the seconds since Jan 1 1900. For the lower 32 bits (LSW), it denotes the fractions of a second. Although it is using NTP timestamp format, it does not necessarily need to be synchronized with Network Time Protocol server.

Since NTP timestamp field is second since Jan 1 1900, you need to add 2,208,988,800 to NTP time to make it to UNIX time (second since 1970).

Now talk more about fractions of a second. See NTP Timestamp will give you a better understand of NTP timestamp. So, fractions of second mean the decimal part of the seconds. For example, 2008-05-07T11:24:35.876-04:00, 876 is the fractional part of the second. In the later part of the series, I will tell how to get the fractional time of the NTP timestamp of SR.

The other important part of SR is the RTP timestamp. It is a RTP timestamp that represent this SR packet. When this SR is sent, some time must have elapsed, and thus, this RTP timestamp will not be the same as the previous RTP timestamp. This is important because SR RTP timestamp is used for inter-media synchronization.

See RTP - Lip Sync Part 2, The Overview

Comments

Popular Posts