webrtc-pc icon indicating copy to clipboard operation
webrtc-pc copied to clipboard

Is "same PT, different FMTP lines" allowed in BUNDLE?

Open henbos opened this issue 1 year ago • 6 comments

While working on https://github.com/w3c/webrtc-stats/issues/662#issuecomment-1232989049, we discovered that Chrome is able to handle a BUNDLEd transport where different m= sections use the same codec and payload type but where the FMTP line is different. See fiddle (you'd think this would throw, but it doesn't).

The idea that it should be possible to have different FMTP lines for the same PT and transport was expressed by @jan-ivar here and @taylor-b here, while @fippo strongly believes that this should be illegal and there is a bug in Chrome.

I don't know what BUNDLE says but different FMTP lines sounds wrong to me. What should be the correct behavior? (If it is not, some recent code to avoid duplicate RTCCodecStats objects in libwebrtc could be simplified.)

henbos avatar Sep 01 '22 12:09 henbos

I think the following fiddle is forbidden https://jsfiddle.net/fippo/Lrdj4mwu/3/ yet passes

https://www.rfc-editor.org/rfc/rfc8843#name-payload-type-pt-value-reuse says all codecs associated with the payload type number MUST share an identical codec configuration. This means that the codecs MUST share the same media type, encoding name, clock rate, and any parameter that can affect the codec configuration and packetization and https://www.rfc-editor.org/rfc/rfc8859.html#section-5.1 lists fmtp as "identical per pt"

fippo avatar Sep 01 '22 13:09 fippo

Sounds pretty disallowed, filed https://crbug.com/webrtc/14420

henbos avatar Sep 01 '22 13:09 henbos

Just want to add, in that same thread alvestrand@ says "the way RTP works, there can't be two different codec configurations for the same payload type on the same transport in the same direction", and I trust his knowledge of RTP semantics. I just know how Chrome/libwebrtc works, and the fact that it supports different FMTP lines doesn't mean that's correct.

taylor-b avatar Sep 02 '22 00:09 taylor-b

seems we have a bug in multiple browsers, Firefox accepts the fiddle as well.

fippo avatar Sep 02 '22 06:09 fippo

RFC 8843 has been obsoleted by RFC 9143, but the text @fippo quotes remains the same. So having two FMTP configurations utilizing the same PT is forbidden (although with distinct PTs, they can share the same SSRC as long as the clockrate is the same).

aboba avatar Sep 03 '22 03:09 aboba

Current status: we can't fix browsers since there is too much actual usage and we don't know who needs to fix their code.

fippo avatar Jan 17 '24 06:01 fippo