I am building web chat based on Janus media server. The problem occurs when I am testing in a mobile browser and change network (ex. disable/enable Wi-Fi).
After I do that, something is preventing establishing valid peer connection - when attaching media stream to video component there is no video and bitrate is 0. Also if I publish video from this mobile user, subscriber from another end can subscribe to my stream, but gets empty video/audio as well.
I've already tried triggering ICE renegotiation, it had no effect.
What is killing me is that usually people struggling fixing peer connection "smoothly" without page refresh and etc. In my case neither page refresh, nor Janus server restart, nor backend server restart doesn't help. This is one of the main reasons why I don't blame internal logic. Problem gets fixed after some big amount of time (I usually test next day).
If I switch back to initial type of connection and resubscribe - video stream restores.
I am not expecting to get full solution here, but rather to get advice about what could cause given symptoms. I've already spent weeks on solving this bit.
here is subscriber handle info from admin monitor:
{
"session_id": 5720008786817209,
"session_last_activity": 6209682888251,
"session_transport": "janus.transport.http",
"handle_id": 6533528277151528,
"opaque_id": "sfutest-680291",
"loop-running": true,
"created": 6209682084107,
"current_time": 6209693977397,
"plugin": "janus.plugin.videoroom",
"plugin_specific": {
"type": "subscriber",
"room": 681365,
"private_id": 1730265710,
"feed_id": 4541903455858496,
"feed_display": "681365",
"media": {
"audio": true,
"audio-offered": true,
"video": true,
"video-offered": true,
"data": false,
"data-offered": true
},
"simulcast": {
"substream": -1,
"substream-target": 2,
"temporal-layer": -1,
"temporal-layer-target": 2
},
"hangingup": 0,
"destroyed": 0
},
"flags": {
"got-offer": true,
"got-answer": true,
"negotiated": true,
"processing-offer": false,
"starting": true,
"ice-restart": false,
"ready": true,
"stopped": false,
"alert": false,
"trickle": true,
"all-trickles": true,
"resend-trickles": false,
"trickle-synced": false,
"data-channels": false,
"has-audio": true,
"has-video": true,
"new-datachan-sdp": false,
"rfc4588-rtx": true,
"cleaning": false
},
"agent-created": 6209682284915,
"ice-mode": "full",
"ice-role": "controlling",
"sdps": {
"profile": "UDP/TLS/RTP/SAVPF",
"local": "v=0\r\no=- 1596975263019095 1 IN IP4 185.12.12.24\r\ns=VideoRoom 681365\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS janus\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 185.12.12.24\r\na=sendonly\r\na=mid:audio\r\na=rtcp-mux\r\na=ice-ufrag:sCux\r\na=ice-pwd:NK9E7vrPjeXDO2Q0DL3hIf\r\na=ice-options:trickle\r\na=fingerprint:sha-256 39:45:8D:E3:AB:4E:6D:55:63:07:16:39:14:FF:C1:8F:8C:3A:C1:32:FF:B8:2D:B5:42:C0:99:06:DB:BE:71:43\r\na=setup:actpass\r\na=rtpmap:111 opus/48000/2\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=rtcp-fb:111 transport-cc\r\na=msid:janus janusa0\r\na=ssrc:3513017309 cname:janus\r\na=ssrc:3513017309 msid:janus janusa0\r\na=ssrc:3513017309 mslabel:janus\r\na=ssrc:3513017309 label:janusa0\r\na=candidate:1 1 udp 2015363327 185.12.12.24 58146 typ host\r\na=end-of-candidates\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97\r\nc=IN IP4 185.12.12.24\r\na=sendonly\r\na=mid:video\r\na=rtcp-mux\r\na=ice-ufrag:sCux\r\na=ice-pwd:NK9E7vrPjeXDO2Q0DL3hIf\r\na=ice-options:trickle\r\na=fingerprint:sha-256 39:45:8D:E3:AB:4E:6D:55:63:07:16:39:14:FF:C1:8F:8C:3A:C1:32:FF:B8:2D:B5:42:C0:99:06:DB:BE:71:43\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=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:13 urn:3gpp:video-orientation\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=ssrc-group:FID 163753807 2929619259\r\na=msid:janus janusv0\r\na=ssrc:163753807 cname:janus\r\na=ssrc:163753807 msid:janus janusv0\r\na=ssrc:163753807 mslabel:janus\r\na=ssrc:163753807 label:janusv0\r\na=ssrc:2929619259 cname:janus\r\na=ssrc:2929619259 msid:janus janusv0\r\na=ssrc:2929619259 mslabel:janus\r\na=ssrc:2929619259 label:janusv0\r\na=candidate:1 1 udp 2015363327 185.12.12.24 58146 typ host\r\na=end-of-candidates\r\n",
"remote": "v=0\r\no=- 2846574689702018810 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:iTKh\r\na=ice-pwd:YcBYvuoYtPN74wLGsmRYZPkC\r\na=ice-options:trickle\r\na=fingerprint:sha-256 44:62:26:8A:9B:2C:35:82:62:07:1C:36:1B:3D:84:B0:D7:1C:A2:9D:A3:57:D0:41:E8:D6:F9:D8:9A:77:04:FE\r\na=setup:active\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:iTKh\r\na=ice-pwd:YcBYvuoYtPN74wLGsmRYZPkC\r\na=ice-options:trickle\r\na=fingerprint:sha-256 44:62:26:8A:9B:2C:35:82:62:07:1C:36:1B:3D:84:B0:D7:1C:A2:9D:A3:57:D0:41:E8:D6:F9:D8:9A:77:04:FE\r\na=setup:active\r\na=mid:video\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\n"
},
"queued-packets": 0,
"streams": [
{
"id": 1,
"ready": -1,
"ssrc": {
"audio": 3513017309,
"video": 163753807,
"video-rtx": 2929619259
},
"direction": {
"audio-send": true,
"audio-recv": false,
"video-send": true,
"video-recv": false
},
"extensions": {
"urn:ietf:params:rtp-hdrext:sdes:mid": 2,
"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01": 3,
"urn:ietf:params:rtp-hdrext:ssrc-audio-level": 1,
"urn:3gpp:video-orientation": 13
},
"bwe": {
"twcc": true,
"twcc-ext-id": 3
},
"nack-queue-ms": 200,
"rtcp_stats": {
"audio": {
"base": 48000,
"rtt": 0,
"lost": 0,
"lost-by-remote": 0,
"jitter-local": 0,
"jitter-remote": 0,
"in-link-quality": 0,
"in-media-link-quality": 0,
"out-link-quality": 0,
"out-media-link-quality": 0
},
"video": {
"base": 90000,
"rtt": 0,
"lost": 0,
"lost-by-remote": 0,
"jitter-local": 0,
"jitter-remote": 0,
"in-link-quality": 0,
"in-media-link-quality": 0,
"out-link-quality": 0,
"out-media-link-quality": 0
}
},
"components": [
{
"id": 1,
"state": "ready",
"connected": 6209682688321,
"local-candidates": [
"1 1 udp 2015363327 185.12.12.24 58146 typ host"
],
"remote-candidates": [
"remote1 1 udp 1853759231 188.26.223.217 59505 typ prflx raddr 188.26.223.217 rport 59505\r\n",
"1287214573 1 udp 2122194687 192.168.1.131 59505 typ host generation 0 ufrag iTKh network-id 1 network-cost 10",
"4213993584 1 udp 2122262783 2a0c:5a80:190e:2b00:6d56:6bd7:468e:1b1b 53024 typ host generation 0 ufrag iTKh network-id 2 network-cost 10"
],
"selected-pair": "185.12.12.24:58146 [host,udp] <-> 188.26.223.217:59505 [prflx,udp]",
"dtls": {
"fingerprint": "39:45:8D:E3:AB:4E:6D:55:63:07:16:39:14:FF:C1:8F:8C:3A:C1:32:FF:B8:2D:B5:42:C0:99:06:DB:BE:71:43",
"remote-fingerprint": "44:62:26:8A:9B:2C:35:82:62:07:1C:36:1B:3D:84:B0:D7:1C:A2:9D:A3:57:D0:41:E8:D6:F9:D8:9A:77:04:FE",
"remote-fingerprint-hash": "sha-256",
"dtls-role": "passive",
"dtls-state": "connected",
"retransmissions": 0,
"valid": true,
"srtp-profile": "SRTP_AEAD_AES_256_GCM",
"ready": true,
"handshake-started": 6209682688345,
"connected": 6209682837110,
"sctp-association": false
},
"in_stats": {
"audio_packets": 0,
"audio_bytes": 0,
"audio_bytes_lastsec": 0,
"do_audio_nacks": false,
"video_packets": 0,
"video_bytes": 0,
"video_bytes_lastsec": 0,
"do_video_nacks": true,
"video_nacks": 0,
"video_retransmissions": 0,
"data_packets": 4,
"data_bytes": 1056
},
"out_stats": {
"audio_packets": 0,
"audio_bytes": 0,
"audio_bytes_lastsec": 0,
"audio_nacks": 0,
"video_packets": 0,
"video_bytes": 0,
"video_bytes_lastsec": 0,
"video_nacks": 0,
"data_packets": 2,
"data_bytes": 1259
}
}
]
}
]
}