deepch / RTSPtoWSMP4f

RTSP Stream to WebBrowser MSE over WebSocket based MP4f segments
240 stars 64 forks source link

High Latency #31

Closed petryx closed 3 years ago

petryx commented 3 years ago

Hi @deepch,

Firstable your project is very good. Congratulations for your work.

I'm trying to fix a high latency, about 5 seconds. There is a way to fine tune the initialization of a view, I think this delay is caused in the initialization of the video.

Could you indicate if possible where to make an adjustment to the source code?

delay_5s_LI

deepch commented 3 years ago

Do you have such a delay in all browsers?

petryx commented 3 years ago

Yes, I tested it on Chrome and Firefox, and both there is the same behavior

vdalex25 commented 3 years ago

please tell me how do you measure the delay? it is a bad idea compare the time set on the camera with the time in the operating system

petryx commented 3 years ago

Hello @vdalex25, you are right.

I took another measurement using the camera's own software.

And in this measurement, a very high delay appears. As seen in the image below.

Browser_vs_cam

But when I refresh the page the delay disappears.

Browser_vs_cam_2

Is there a way to force the video player refresh? So, for example, when you start playing the video, do you apply a refresh (Eliminate 5s delay), and when the TAB is in focus again, do you refresh again?

deepch commented 3 years ago

It appears if you minimize the tab?

petryx commented 3 years ago

This appears in two moments

vdalex25 commented 3 years ago

i added commit https://github.com/deepch/RTSPtoWSMP4f/commit/444db33c8553d909b7eebbf060b89b39b6bf25dd fixed pause on minimization the tab or when the tab lost the focus

petryx commented 3 years ago

Congratulations, now is working like a charm.