Why would an SDP have different candidate addresses for audio and video?

79 views
Skip to first unread message

davidsw...@gmail.com

unread,
Sep 21, 2022, 2:21:08 AM9/21/22
to discuss-webrtc
During ICE-gathering by a browser, is each candidate dedicated to either video or audio but not both? We cut short ICE-gathering when we detect that a candidate is usable to us (i.e. not IPv6 and not private IPv4) and I was surprised just now to see an offer SDP that had srflx and relay candidates for video but only unusable hosts for audio. The only way I can explain that is to guess that candidates are for one medium or the other, but I don't see any indication like that in the stringification of the candidates.

A bit later I came across sdpMid and sdpMLine in the spec, but these don't appear in any candidates in the SDP I'm investigating.

If we do SDP-munging, what can we check in the candidates to ensure we have a usable one for video and a usable one for audio? I had thought that checking for the usability of the IP number was enough.

Rajneesh Soni

unread,
Sep 21, 2022, 2:46:07 AM9/21/22
to discuss-webrtc
you need to play around with peerconnection `bundlePolicy` configuration.
If you need same transport for both audio and video you need to use `max-bundle`

Philipp Hancke

unread,
Sep 21, 2022, 2:54:04 AM9/21/22
to discuss...@googlegroups.com
Unless you have backward compability requirements you should use bundlePolicy: max-bundle which will gather the same candidates for all m-lines.
Trying to build your custom logic ontop of an already overly complicated thing like the ICE engine isn't going to end well.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/c6f008b8-66fc-48aa-b274-8c59e7f96db0n%40googlegroups.com.

davidsw...@gmail.com

unread,
Sep 21, 2022, 5:31:43 AM9/21/22
to discuss-webrtc
Thanks very much for the advice.

When I try bundlePolicy:max-bundle instead of bundlePolicy:max-compat, Freeswitch's js library encounters the following error on Chrome 106.0.5249.40 (Official Build) beta (64-bit) / Win10:

   InvalidAccessError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Answer cannot remove m= section with mid='0' from already-established BUNDLE group.

when calling:

   peer.setRemoteDescription(
    new window.RTCSessionDescription(sdp)
    )

If it matters, in our offers in m=audio we set a=sendrecv and in m=video we set a=sendonly
The answer seems well-formed; in particular its m=audio contains a=sendrecv and its m=video has a=recvonly. The answer has no 'mid', so the error is especially confusing to me.

Lorenzo Miniero

unread,
Sep 23, 2022, 10:41:07 AM9/23/22
to discuss-webrtc
IIRC FreeSwitch doesn't support audio and video on the same port, but this may have been changed since I last checked.

L.
Reply all
Reply to author
Forward
0 new messages