deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.27k stars 302 forks source link

Stream sporadicly not working across all browsers #245

Closed stefanetzkorn closed 1 year ago

stefanetzkorn commented 1 year ago

I am using the latest Build running in a docker container, the Problem also occurs without using Docker and running it normal. For the website i am using the example provided in https://github.com/deepch/RTSPtoWeb/tree/master/docs/examples/webrtc

Sometimes the stream just does not load. I already testet it with Android (Chrome), Apple (Safari), Chrome and Firefox on Windows. Here is the error i am getting in Chrome whenever the stream does not start: Error Chrome

At the same time the following error comes up on the server itself: level=error msg=gatherCompletePromise wait" call=WriteHeader channel=0 func=HTTPAPIServerStreamWebRTC module=http_webrtc stream=MAINSTREAM

Its random whenever it will work or not, sometimes i need to refresh the page a few times before it works, somtimes it works right away.

VitalyVaryvdin commented 1 year ago

Getting the same issue on random streams every time i reload page. Some retries later it loads successfully. ffplay is able to play stream, thought it drops some packets every or so frame Did you manage to solve this?

Upd: discovered something weird. If i initialize WebRTC while cameras have no connection and then connect cameras - all streams work just fine, but if cameras have connection while i initialize WebRTC - set of random cameras just fails to initialize, and some of them never initialize (in reasonable amount of time) until i reload page (which results in another set of cameras failing)