Subject: [AVT] RTP timestamp and multiple sample rates

From: Ingemar Johansson S <[email-masked]>
Date: Tue, 1 Jun 2010 11:12:08 +0200

Hi

I have a faint memory that this question was raised before.
Suppose that we specify two audio codecs with different sample rates in the SDP

m=audio 54320 RTP/AVP 96 97
a=fmtp:96 AMR-WB/16000
a=fmtp:97 AMR-NB/8000

The sender can switch freely between the codecs and we assume that the decoder is smart enough to handle the switch.
The question the arise.. How do we know if the RTP TS value in the RTCP SR relates to  the 8000 or the 16000 sample rate ?.
Can RFC 5576 be used in some intelligent way ?

/Ingemar

=================================
INGEMAR JOHANSSON  M.Sc. 
Senior Research Engineer 

Ericsson AB
Multimedia Technologies
Labratoriegränd 11
971 28, Luleå, Sweden
Phone +46-1071 43042
SMS/MMS +46-73 078 3289
[email-masked]
www.ericsson.com 
Visit http://labs.ericsson.com !
=================================

---

From: Marc Petit-Huguenin <[email-masked]>
Date: Tue, 01 Jun 2010 06:32:04 -0700

> The question the arise.. How do we know if the RTP TS value in the RTCP SR relates to  the 8000 or the 16000 sample rate ?.

Please have a look to the following I-D, that tries to answer that question:

https://datatracker.ietf.org/doc/draft-petithuguenin-avt-multiple-clock-rates/

See also the presentation at Anaheim:

http://www.ietf.org/proceedings/77/slides/avt-6.pdf

I plan to release another version after I received the results from the last SIPit.

> Can RFC 5576 be used in some intelligent way ?

- -- 
Marc Petit-Huguenin
Personal email: [email-masked]
Professional email: [email-masked]
Blog: http://blog.marc.petit-huguenin.org

---

From: Ingemar Johansson S <[email-masked]>
Date: Thu, 3 Jun 2010 13:23:12 +0200

Hi

And thanks for refreshing my memory. It seems like when I read the draft that the most simple method is to use the non-monothonic TS option. 

My interpretation of this is that it is necessary for the receiver to keep a list of the last received timestamps and their associated sample rate for correct calculation. This list should of course be quite small. Do I understand things correctly ?

/Ingemar

> -----Original Message-----
> From: Marc Petit-Huguenin [mailto:[email-masked]] 
> Sent: den 1 juni 2010 15:32
> To: Ingemar Johansson S
> Cc: [email-masked]; mmusic
> Subject: Re: [AVT] RTP timestamp and multiple sample rates
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > Suppose that we specify two audio codecs with different 
> sample rates 
> > in the SDP
> > 
> > The sender can switch freely between the codecs and we 
> assume that the decoder is smart enough to handle the switch.
> > The question the arise.. How do we know if the RTP TS value 
> in the RTCP SR relates to  the 8000 or the 16000 sample rate ?.
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> 
> iEYEARECAAYFAkwFC9IACgkQ9RoMZyVa61epVwCeMix5XmnxfvmugsCqhZ2dniHF
> W5YAn35582fKqKM4mPIovE1Na+S3YBGm
> =sbLc
> -----END PGP SIGNATURE-----
>

---

From: Marc Petit-Huguenin <[email-masked]>
Date: Thu, 03 Jun 2010 10:26:20 -0700

> And thanks for refreshing my memory. It seems like when I read the draft that the most simple method is to use the non-monothonic TS option.

As long as you do not need RTCP, yes.

> My interpretation of this is that it is necessary for the receiver to keep a list of the last received timestamps and their associated sample rate for correct calculation. This list should of cours…

The beauty of the non-monotonic TS is that you can use the same formula that is
in RFC 3550, and keep only the information from the previous packet.  You just
have to convert the timestamp to the time in seconds by dividing it by the clock
rate, which is associated with the payload type of your packet.  In a real
implementation you probably convert to a common clock rate instead of the time
in seconds, i.e. 16000 in your example, to not have to use floats.

- -- 
Marc Petit-Huguenin