Subject: [AVT] RTP timestamps for pre-recorded audio?

From: Skill Zero <[email-masked]>
Date: Mon, 21 Mar 2005 04:21:28 -0800

I'm new to RTP and unsure about the right way to generate and process
RTP timestamps. I'm hoping this is an appropriate list to ask about
it. I've read all the related RTP RFCs and books I could find, but I'm
still not confident I know the right way to deal with timestamps in
code.

I'm writing a server app to send pre-recorded audio over RTP and a
client app to run on multiple computers to receive and play that audio
(hopefully in sync). I'm using 44,100 KHz, 16-bit samples, which
translates to 360 stereo samples per RTP packet (1500 MTU - 40 IPv6
header - 8 UDP header - 12 RTP header = 1440 / 4 = 360) or about
8163.27 microseconds (not a nice number!) per packet.

Since the server isn't getting audio from a live source, should I
approximate when to send each packet using wallclock time (e.g. delay
for ~8163 microseconds before sending each RTP packet and deal with
the timing error accumulating later? Should the RTP timestamp always
increment by the sample count (360) in this case?

When silence suppression is used, do I just have to estimate the
number of samples that would have occurred, using wallclock time, to
keep track of where the RTP timestamp should be for the next RTP
packet, like this:

Silence RTP Timestamp delta = (Wallclock silence end - start) * 44100?

When using a 90 KHz rate (e.g. MPEG audio), should I convert the
samples per frame to 90 KHz (e.g. (1152 / 44100) * 90000 = ~2351 RTP
timestamp units per frame)? I've looked at some code that seemed to
use the wallclock time * 90000 for the timestamp so I wasn't sure.

Am I understanding things correctly? Any feedback would be much appreciated.

_______________________________________________
Audio/Video Transport Working Group
[email-masked]
https://www1.ietf.org/mailman/listinfo/avt