RE: Mapping RTX in SDP to ORTC RtpParameters

Great question, Inaki!  

We probably should have examples in the spec to explain on how this all works, not only for RTX, but also for RED and FEC. 

In the example, you are retransmitting VP8 (PT 100, SSRC 1762798695) with RTX (PT 96, SSRC 3360043549), and you are retransmitting VP9 (PT 101, SSRC 1762798695) with RTX (PT 97, SSRC 4444444444), correct?
I am not sure what the 3360043549 SSRC is for, since the retransmission stream for VP9 has a distinct SSRC (can't be the same one used to retransmit VP8, since it is a separate stream). 

My understanding is that to do this you only need to set RTX as a codec once,  such as 
     parameters. codecs[5].name = "rtx";
     parameters.codecs[5].payloadType = 96; 

Then for VP8, you will set: 
      parameters.codecs[3].name = "vp8"
      parameters.codecs[3].payloadType = 100;
      parameters.encodings[0].ssrc = 1762798695;
      parameters.encodings[0].codecPayloadType = 100;
      parameters.encodings[0].rtx.ssrc = 3360043549;
      parameters.encodings[0].rtx.payloadType = 96; 

For VP9, you will set: 

      parameters.codecs[4].name = "vp9"
      parameters.codecs[4].payloadType = 101;
      parameters.encodings[0].ssrc = 1762798695;
      parameters.encodings[0].codecPayloadType = 101;
      parameters.encodings[0].rtx.ssrc = 4444444444;
      parameters.encodings[0].rtx.payloadType = 97;

 


-----Original Message-----
From: Iñaki Baz Castillo [mailto:ibc@aliax.net] 
Sent: Thursday, March 3, 2016 3:14 PM
To: public-ortc@w3.org
Subject: Mapping RTX in SDP to ORTC RtpParameters

Hi, this is what a browser wants to send (some ines omitted):

m=video 55154 UDP/TLS/RTP/SAVPF 100 101 96
a=rtpmap:100 VP8/90000
a=rtpmap:101 VP9/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=ssrc-group:FID 1762798695 3360043549
a=ssrc:1762798695 cname:S1TpdiJRYh4zmAJw
a=ssrc:3360043549 cname:S1TpdiJRYh4zmAJw


I want to generate the RTCRtpParameters for the corresponding RTCRtpSender in ORTC.

As you can see, there are three codecs (VP8:100, VP9:101, rtx:96), all of them with clockRate 90000.

According to "a=fmtp:96 apt=100", rtx is just used for VP8:100 codec.
And according to the a=ssrc and a=ssrc-group lines, there are two SSRC
(1762798695 and 3360043549) for sending VP8, VP9 and rtx.

Now the questions:

1) If the browser also wishes to send rtx for VP9:101, should it add another rtx codec as follows (and of course a new SSRC)?:

  a=rtpmap:97 rtx/90000
  a=fmtp:97 apt=101
  a=ssrc-group:FID 1762798695 3360043549 4444444444
  a=ssrc:4444444444 cname:S1TpdiJRYh4zmAJw




2) If 1) is correct, how to map it in ORTC? According to the spec:

  9.12.1 Dictionary RTCRtpRtxParameters Members

  payloadType
    The payload type to use for retransmission. If unset,
    RTCRtpCodecParameters.payloadType for the "rtx" codec is used.

  ssrc
    The SSRC to use for retransmission, as specified in [RFC4588].

But how to specify the relationship between rtx:96 and VP8:100, and
rtx:97 and VP9:101? Should it be done by setting 100 and 101 in the `codecPayloadType` of each RtpEncondingParameters object?



3) How to know which SSRC will be used for VP8:100+VP9:101, rtx:96, and rtx:97 streams? The line ssrc-group just states that those tree SSRC values have a relationship, but RFC4588 does not define how each SSRC in a group is associated to the sending codecs.




--
Iñaki Baz Castillo
<ibc@aliax.net>

Received on Friday, 4 March 2016 00:25:11 UTC