meetecho / janus-gateway

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

[1.x] Getting same `feed_id` for 2 different `mid` #3326

Closed SakibFarhad closed 9 months ago

SakibFarhad commented 9 months ago

What version of Janus is this happening on? 1.2.1

For the following request

{"janus":"message","transaction":"grllwjts0v","body":{"request":"subscribe","streams":[{"feed":8719057493803743}]},"token":"a1b2c3d4","handle_id":3536714810654766,"session_id":6160057794401320}

we are getting following response where for different mid we are getting same user

{
   "janus": "event",
   "session_id": 6160057794401320,
   "transaction": "grllwjts0v",
   "sender": 3536714810654766,
   "plugindata": {
      "plugin": "janus.plugin.videoroom",
      "data": {
         "videoroom": "updated",
         "room": 7189261412301019,
         "streams": [
            {
               "type": "video",
               "active": true,
               "mindex": 0,
               "mid": "0",
               "ready": true,
               "send": true,
               "feed_id": 8719057493803743,
               "feed_display": "{\"display\":\"Koushik Deb\",\"audio\":true,\"video\":true}",
               "feed_mid": "0",
               "codec": "vp8"
            },
            {
               "type": "video",
               "active": true,
               "mindex": 1,
               "mid": "1",
               "ready": false,
               "send": true,
               "feed_id": 8719057493803743,
               "feed_display": "{\"display\":\"Koushik Deb\",\"audio\":true,\"video\":true}",
               "feed_mid": "0",
               "codec": "vp8"
            }
         ]
      }
   },
   "jsep": {
      "type": "offer",
      "sdp": "v=0\r\no=- 1706507705175979 2 IN IP4 54.163.154.72\r\ns=VideoRoom 7189261412301019\r\nt=0 0\r\na=group:BUNDLE 0 1\r\na=ice-options:trickle\r\na=fingerprint:sha-256 96:81:01:01:5D:72:4E:4B:3E:E7:9D:1A:3B:77:57:94:D4:3D:C6:5D:04:1F:FB:47:38:2A:54:7C:D7:A1:22:C5\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS *\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97\r\nc=IN IP4 54.163.154.72\r\na=sendonly\r\na=mid:0\r\na=rtcp-mux\r\na=ice-ufrag:IE0C\r\na=ice-pwd:cdHWswZRJSd4ck48OgVIUF\r\na=ice-options:trickle\r\na=setup:actpass\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=extmap:2 [http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3](http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time%5Cr%5Cna=extmap:3) [http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:4](http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01%5Cr%5Cna=extmap:4) urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:12 [http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=rtpmap:97](http://www.webrtc.org/experiments/rtp-hdrext/playout-delay%5Cr%5Cna=rtpmap:97) rtx/90000\r\na=fmtp:97 apt=96\r\na=ssrc-group:FID [4155852607](tel:4155852607) 1693477328\r\na=msid:janus janus0\r\na=ssrc:[4155852607](tel:4155852607) cname:janus\r\na=ssrc:[1693477328](tel:1693477328) cname:janus\r\na=candidate:1 1 udp [2015363327](tel:2015363327) 54.163.154.72 33982 typ host\r\na=candidate:2 1 udp [2015363583](tel:2015363583) 54.163.154.72 23911 typ host\r\na=candidate:3 1 udp [1679819007](tel:1679819007) 54.163.154.72 33982 typ srflx raddr 10.10.30.81 rport 33982\r\na=end-of-candidates\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97\r\nc=IN IP4 54.163.154.72\r\na=sendonly\r\na=mid:1\r\na=rtcp-mux\r\na=ice-ufrag:IE0C\r\na=ice-pwd:cdHWswZRJSd4ck48OgVIUF\r\na=ice-options:trickle\r\na=setup:actpass\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=extmap:2 [http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3](http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time%5Cr%5Cna=extmap:3) [http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:4](http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01%5Cr%5Cna=extmap:4) urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:12 [http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=rtpmap:97](http://www.webrtc.org/experiments/rtp-hdrext/playout-delay%5Cr%5Cna=rtpmap:97) rtx/90000\r\na=fmtp:97 apt=96\r\na=ssrc-group:FID [2779922010](tel:2779922010) 3721627832\r\na=msid:janus janus1\r\na=ssrc:[2779922010](tel:2779922010) cname:janus\r\na=ssrc:[3721627832](tel:3721627832) cname:janus\r\na=candidate:1 1 udp [2015363327](tel:2015363327) 54.163.154.72 33982 typ host\r\na=candidate:2 1 udp [2015363583](tel:2015363583) 54.163.154.72 23911 typ host\r\na=candidate:3 1 udp [1679819007](tel:1679819007) 54.163.154.72 33982 typ srflx raddr 10.10.30.81 rport 33982\r\na=end-of-candidates\r\n"
   }
}
lminiero commented 9 months ago

mid corresponds to a media stream, not a participant. Your publisher is sending both audio and video, so you get two different mids. Maybe you're confused with msid. That said, please post questions like this on the group, we only use GitHub for code issues.

lminiero commented 9 months ago

@atoppi made me notice that you may be referring to the fact both are video streams, and that both refer to the same source, that is feed_mid: "0". In theory, this can happen if:

  1. the publisher is sending video only
  2. you subscribed to that publisher once
  3. you subscribe to that publisher again

In that case, it would be normal for you go get the same feed twice. If not, there may be a bug. Make sure (via debugging the client side) that you're not unknowingly sending the same subscribe request twice (e.g., once when doing join, and once now via subscribe). As such, please provide the full API sequence, and possibly the SDPs involved (ideally as a gist or pastebin link, not inline here).

SakibFarhad commented 9 months ago

Yes, both are video streams. We don't use audio of videoroom, for audio we use audiobridge. We are collecting the debug log for both server and client.

SakibFarhad commented 9 months ago

Here is the gist URL providing both server and client log.

lminiero commented 9 months ago

Your log demonstrates what I thought: you're subscribing to the same user twice yourself. Before calling subscribe for ID 7628034449938680, you also used switch for the same feed. As such, it's a problem in your client side login, not Janus. Closing.