Learn how to delay the stream flow?

I have an ip camera that broadcasts to the server and server users.
To view the video, the user uses my web small (comes to my website and watches the video), while streaming rtmp stream and played through the video.js player.
The hardware (camera and computer) are fast and delays in they do not, and the weak point is the Internet channel.
How to know how much milliseconds delayed video from the user?
July 2nd 19 at 13:25
1 answer
July 2nd 19 at 13:27
How to know how much milliseconds delayed video from the user?

Sometimes it's not "miles", but seconds... Using RTMP delay in seconds from 1 to 5 usually. If You clarified, why it is necessary - perhaps there would be some more accurate solution.

And generally, judging by specifications RTMP Protocol, there is a PING packet. You can try to catch them using a sniffer and measure the delay or instead of RTMP server to stick some kind of plug (the plug) which would be sent instead of the live ping packets and measure the response time...

*this is more "thinking out loud" as the details of the issue are not known and formulate some kind of "good solution" quite difficult (to me).
There are solutions measuring the speed https://github.com/nesk/network.js .
It can be based on it to measure speed from the server to the client and to determine the delay, because the delay from the camera to the server is always constant and minimum. - columbus26 commented on July 2nd 19 at 13:30
I don't know what the delay will be in the scenario "RTMP on your server", but the delay for example, between me and the broadcasting server is about 30ms, and the video delay (real) - around 3-5sec. Never really wondered where it comes from in my particular case, but with a ping and she had little in common, all the channels no less than 100Mbit, it might be a delay due to transcoding (some closet video is in the buffer and remains there). - Salvado commented on July 2nd 19 at 13:33
: Yes, from the same encoder depends on the speed. Here on this subject a good article https://habrahabr.ru/post/265675/ - columbus26 commented on July 2nd 19 at 13:36

Find more questions by tags Video broadcast