meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.28k stars 2.48k forks source link

[1.x] Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer. #3320

Closed kboek closed 10 months ago

kboek commented 10 months ago

What version of Janus is this happening on? 1.2.2

Have you tested a more recent version of Janus too? No, this is the most recent from the master branch

Was this working before? Unsure

Is there a gdb or libasan trace of the issue? No

Additional context When creating an offer with RTCPeerConnection.createOffer(), the m=video comes first (at mid:0), but in the answer, the m=audio is first. This causes the error on the client side; as the order and media identifiers must match in SDP offer and answer. And therewith causes incompatibility with server-independent players, e.g. https://webrtc.player.eyevinn.technology/?type=whep

answer.txt offer.txt

lminiero commented 10 months ago

You're using the plugins wrong. You're sending a recvonly offer to the VideoRoom (I guess for a subscriber?), that the VideoRoom will ignore, since the VideoRoom plugin always offers for subscribers. If you want to use Janus for WHEP, you need to use the Streaming plugin. https://www.meetecho.com/blog/whep-qui/

kboek commented 10 months ago

Thank you for your response and blog article. So to connect WHIP to WHEP, do I need to create a mountpoint in the Streaming plugin that points to the stream in the Videoroom? And what would be the JSON for the "create" API call to the Streaming plugin?

lminiero commented 10 months ago

Please refer to the Streaming plugin documentation for that.