我已按照kurento-rtsp2webrtc教程的说明在网站中流式传输RTSP。
我可以在本地网络环境上成功运行此演示。
当我尝试在具有VPN的AWS EC2上运行它时,一切正常,但是不幸的是,如果没有VPN,它将在浏览器控制台日志上返回“ oniceconnectionstatechange-> failed”。
浏览器控制台日志为:
This appears to be Chrome
Use freeice
Local icecandidate {"candidate":"candidate:1270274445 1 udp
2113937151 192.168.1.11 48697 typ host generation 0 ufrag KK6A
network-cost 50","sdpMid":"video","sdpMLineIndex":0}
Local icecandidate {"candidate":"candidate:842163049 1 udp
1677729535 110.225.223.220 48697 typ srflx raddr 192.168.1.11
rport 48697 generation 0 ufrag KK6A network-cost 50","sdpMid":"video","sdpMLineIndex":0}
PlayerEndpoint-->WebRtcEndpoint connection established
oniceconnectionstatechange -> checking
icegatheringstate -> complete
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 fe80::8b6:83ff:fee5:39dc 46158 typ host","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:2 1 TCP 1019217151 fe80::8b6:83ff:fee5:39dc 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:3 1 TCP 1015022847 fe80::8b6:83ff:fee5:39dc 28457 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:4 1 UDP 2013266431 172.30.0.128 40094 typ host","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:5 1 TCP 1019216383 172.30.0.128 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:6 1 TCP 1015022079 172.30.0.128 49260 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 fe80::8b6:83ff:fee5:39dc 1406 typ host","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:2 2 TCP 1019217150 fe80::8b6:83ff:fee5:39dc 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"video"}
`enter code here`Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:3 2 TCP 1015022846 fe80::8b6:83ff:fee5:39dc 60510 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:4 2 UDP 2013266430 172.30.0.128 53802 typ host","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:5 2 TCP 1019216382 172.30.0.128 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:6 2 TCP 1015022078 172.30.0.128 1025 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"video"}
Player playing ...
oniceconnectionstatechange -> failed
icegatheringstate -> complete
我还在WebRtcEndPoint.conf.ini中设置了一个电击服务器信息(serverip:8000),但是问题仍然存在。
最佳答案
通过安装Coturn服务器并同时使用STUN和TURN服务器并在AWS上打开端口来解决了问题,具体如下:
https://doc-kurento.readthedocs.io/en/6.6.1/faq.html
关于javascript - Kurento-rtsp2webrtc在AWS上不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50960902/