awslabs / amazon-kinesis-video-streams-webrtc-sdk-js

JS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html
Apache License 2.0
288 stars 145 forks source link

Getting errors with Firefox Viewer #332

Closed vikramdattu closed 4 weeks ago

vikramdattu commented 2 months ago

I can see following errors when I use Firefox Mac (127.0.2 (64-bit)) for viewer only streaming from my client.

[2024-09-05T06:52:29.643Z] [INFO] [VIEWER] Connection to peer successful!
[2024-09-05T06:52:29.645Z] [ERROR] TypeError: iceTransport.getSelectedCandidatePair is not a function
[2024-09-05T06:52:30.571Z] [INFO] [DQP TEST] Measuring stream stats from Master.
[2024-09-05T06:52:30.582Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:31.591Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:32.590Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:33.591Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:34.595Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:35.598Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:36.611Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:37.617Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:38.619Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:39.624Z] [ERROR] TypeError: rttCurrent is undefined
[2024-09-05T06:52:40.629Z] [ERROR] TypeError: rttCurrent is undefined

SDP offer from Firefox:

[2024-09-05T06:52:24.643Z] [DEBUG] SDP offer: {
  "type": "offer",
  "sdp": "v=0\r\no=mozilla...THIS_IS_SDPARTA-99.0 5435239630189805831 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=sendrecv\r\na=fingerprint:sha-256 1E:A0:14:51:15:0E:EA:D1:68:05:E7:3C:3C:CB:96:82:E1:D5:D6:CC:C7:1E:93:68:90:81:36:F9:A7:17:42:FB\r\na=group:BUNDLE 0 1\r\na=ice-options:trickle\r\na=msid-semantic:WMS *\r\nm=video 9 UDP/TLS/RTP/SAVPF 120 124 121 125 126 127 97 98 123 122 119\r\nc=IN IP4 0.0.0.0\r\na=sendrecv\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:5 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:6/recvonly http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\r\na=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1\r\na=fmtp:120 max-fs=12288;max-fr=60\r\na=fmtp:124 apt=120\r\na=fmtp:121 max-fs=12288;max-fr=60\r\na=fmtp:125 apt=121\r\na=fmtp:127 apt=126\r\na=fmtp:98 apt=97\r\na=fmtp:119 apt=122\r\na=ice-pwd:82af6c9b99a52b965fd0c579c68febbd\r\na=ice-ufrag:78e17109\r\na=mid:0\r\na=msid:{208c0e5e-88bd-4490-a70a-d52fcbb4b4ce} {1ac13457-2a9b-4611-972e-12b210fe58fa}\r\na=rtcp-fb:120 nack\r\na=rtcp-fb:120 nack pli\r\na=rtcp-fb:120 ccm fir\r\na=rtcp-fb:120 goog-remb\r\na=rtcp-fb:120 transport-cc\r\na=rtcp-fb:121 nack\r\na=rtcp-fb:121 nack pli\r\na=rtcp-fb:121 ccm fir\r\na=rtcp-fb:121 goog-remb\r\na=rtcp-fb:121 transport-cc\r\na=rtcp-fb:126 nack\r\na=rtcp-fb:126 nack pli\r\na=rtcp-fb:126 ccm fir\r\na=rtcp-fb:126 goog-remb\r\na=rtcp-fb:126 transport-cc\r\na=rtcp-fb:97 nack\r\na=rtcp-fb:97 nack pli\r\na=rtcp-fb:97 ccm fir\r\na=rtcp-fb:97 goog-remb\r\na=rtcp-fb:97 transport-cc\r\na=rtcp-fb:123 nack\r\na=rtcp-fb:123 nack pli\r\na=rtcp-fb:123 ccm fir\r\na=rtcp-fb:123 goog-remb\r\na=rtcp-fb:123 transport-cc\r\na=rtcp-fb:122 nack\r\na=rtcp-fb:122 nack pli\r\na=rtcp-fb:122 ccm fir\r\na=rtcp-fb:122 goog-remb\r\na=rtcp-fb:122 transport-cc\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:120 VP8/90000\r\na=rtpmap:124 rtx/90000\r\na=rtpmap:121 VP9/90000\r\na=rtpmap:125 rtx/90000\r\na=rtpmap:126 H264/90000\r\na=rtpmap:127 rtx/90000\r\na=rtpmap:97 H264/90000\r\na=rtpmap:98 rtx/90000\r\na=rtpmap:123 ulpfec/90000\r\na=rtpmap:122 red/90000\r\na=rtpmap:119 rtx/90000\r\na=setup:actpass\r\na=ssrc:1942190857 cname:{66723dca-7052-42a8-8f1d-0562258856df}\r\na=ssrc:4207125463 cname:{66723dca-7052-42a8-8f1d-0562258856df}\r\na=ssrc-group:FID 1942190857 4207125463\r\nm=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101\r\nc=IN IP4 0.0.0.0\r\na=recvonly\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\r\na=fmtp:101 0-15\r\na=ice-pwd:82af6c9b99a52b965fd0c579c68febbd\r\na=ice-ufrag:78e17109\r\na=mid:1\r\na=rtcp-mux\r\na=rtpmap:109 opus/48000/2\r\na=rtpmap:9 G722/8000/1\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:101 telephone-event/8000\r\na=setup:actpass\r\na=ssrc:1025890743 cname:{66723dca-7052-42a8-8f1d-0562258856df}\r\n"
}

Response received from my client:

[2024-09-05T06:52:27.732Z] [DEBUG] SDP answer: {
  "type": "answer",
  "sdp": "v=0\r\no=- 1508840628 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1\r\na=msid-semantic: WMS myKvsVideoStream\r\nm=video 9 UDP/TLS/RTP/SAVPF 126\r\nc=IN IP4 127.0.0.1\r\na=candidate:0 1 udp 2130706431 192.168.20.102 55773 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999\r\na=candidate:1 1 udp 1694498815 192.168.20.102 55774 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999\r\na=msid:myKvsVideoStream myVideoTrack\r\na=ssrc:626207205 cname:czp3BMpoBtVMJeSl\r\na=ssrc:626207205 msid:myKvsVideoStream myVideoTrack\r\na=ssrc:626207205 mslabel:myKvsVideoStream\r\na=ssrc:626207205 label:myVideoTrack\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:tYBQ\r\na=ice-pwd:1RxkQcyW2ISF9LgWEzr9ddjs\r\na=ice-options:trickle\r\na=fingerprint:sha-256 BE:71:71:85:32:7C:D6:D7:11:9B:CD:40:B5:47:6C:82:18:72:45:4F:82:6B:F4:FF:2E:7A:8A:66:26:7E:84:01\r\na=setup:active\r\na=mid:0\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:126 H264/90000\r\na=rtcp-fb:126 nack pli\r\na=rtcp-fb:126 nack pli\r\na=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\r\na=ssrc:626207205 cname:czp3BMpoBtVMJeSl\r\na=ssrc:626207205 msid:myKvsVideoStream myVideoTrack\r\na=rtcp-fb:126 goog-remb\r\na=rtcp-fb:126 nack\r\nm=audio 9 UDP/TLS/RTP/SAVPF 109\r\nc=IN IP4 127.0.0.1\r\na=candidate:0 1 udp 2130706431 192.168.20.102 55773 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999\r\na=candidate:1 1 udp 1694498815 192.168.20.102 55774 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999\r\na=msid:myKvsVideoStream myAudioTrack\r\na=ssrc:1968153808 cname:czp3BMpoBtVMJeSl\r\na=ssrc:1968153808 msid:myKvsVideoStream myAudioTrack\r\na=ssrc:1968153808 mslabel:myKvsVideoStream\r\na=ssrc:1968153808 label:myAudioTrack\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:tYBQ\r\na=ice-pwd:1RxkQcyW2ISF9LgWEzr9ddjs\r\na=ice-options:trickle\r\na=fingerprint:sha-256 BE:71:71:85:32:7C:D6:D7:11:9B:CD:40:B5:47:6C:82:18:72:45:4F:82:6B:F4:FF:2E:7A:8A:66:26:7E:84:01\r\na=setup:active\r\na=mid:1\r\na=sendonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:109 opus/48000/2\r\na=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\r\na=ssrc:1968153808 cname:czp3BMpoBtVMJeSl\r\na=ssrc:1968153808 msid:myKvsVideoStream myAudioTrack\r\na=rtcp-fb:109 goog-remb\r\na=rtcp-fb:109 nack\r\n"
}

Also, I am not able to see Firefox decoding the H264 video.

Any ideas what could be wrong?

stefankiesz commented 2 months ago

Hi Vikram, it looks like that WebRTC function is not supported by Firefox: image [source]

Are you able to test on a different browser?

vikramdattu commented 2 months ago

On Chrome at least, I am able to run it. Even if I get above error, I can see bitrate in Firefox and the other client sending the data. But Firefox is not decoding and displaying the same. Even if the above error is seen and the above API is not implemented, you please confirm if Firefox indeed is not supported with KVS WebRTC?

stefankiesz commented 2 months ago

Firefox is supported by KVS WebRTC. This error will not affect functionality as the unsupported function is only used to log selected ice candidate information. I am able to stream to a Firefox viewer using our WebRTC-C SDK master sample. However, I am not able to reproduce the [ERROR] TypeError: rttCurrent is undefined error and will further investigate what could be the cause.

Are you able to test using a master from any of our provided samples such as WebRTC-C or the JS Test Page? Preferrably running on a separate devices from the one running this JS Viewer.

stefankiesz commented 4 weeks ago

Closing due to 1 month no response.