muaz-khan / RTCMultiConnection

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
https://muazkhan.com:9001/
MIT License
2.57k stars 1.37k forks source link

high latency using turn server as relay #792

Open AliBahramiEhsan opened 5 years ago

AliBahramiEhsan commented 5 years ago

Thanks for your great work here! really amazing. I implemented a video/voice chat using this repo. I deployed and configured my turn server via coturn: turnserver -a -o -v -n -p 3478 --no-dtls --no-tls -u someusername:somepassword -r "somerealm" when two person trying to connect each other, If there were no direct path (symmetric NATs and Firewalls), webrtc decides to use turn server as a middle man, relaying two person. My problem is about high latency caused in this scenario. There is a 5-10 seconds latency. That seems weird to me why after some time quality is not reduced and latency goes down?

First question is that what causes this latency? And the second is what can I do to reduce it? In my application, latency is the most important thing and quality is not that much important. Thanks Muaz and Commiunity

rtarta commented 5 years ago

@AliBahramiEhsan Hi, you can use twillo travelsal network solutions. it has auto balance and you can use it verywell . you can also set video dimention rtcmulticonnection .

AliBahramiEhsan commented 5 years ago

@rtarta Thanks for your reponse. Seems Twillo has no free acount and all of their product needs payment. Can you answer my first question? Is that the turn problem? or it's in client side (rtcmulticonnection)? If the problem related to turn, I have to investigate more on other services like Twillio.

Patrick-Vogt commented 5 years ago

Try to figure out the server load at the turn instance and check via getstats or webrtc-internals in chrome how much bandwidth etc is used.

rtarta commented 5 years ago

@AliBahramiEhsan i did not say its free, sure turn problem, if you create trail account and set turn you can see the result.