Reputation: 3951
My application uses real time video stream that shows some presentation to users in real time(!). I have an ip camera and video encoder installed my computer and a server thats serves the video(ustream).
There is delay time that is near 30 seconds between serving video and real video.
This problem is insignificant problem for my situation. But in my situation all users must see same screen in same time. (no lag) Like a real time video game!
First question is why there is a lag(nearly 4 seconds!) between users ? Second question how can i get this lag time to zero or low-lag ?
Edit:
Stream Provider is ustream.com, h264 encode 360p 750fps
Upvotes: 1
Views: 1667
Reputation: 822
As it was mentioned before, your latency between what happens and what user see is collected from:
So I hope that you see how many things you have to optimize to get latency less than 1000 ms.
We have implemented WebRTC server and have achieved around 300 ms latency from IP camera to server and from server to browser. So regular plain browser gets video after 300 ms. Video is transferred from Moscow to Amsterdam and back.
WebRTC is really a good way to go for you with such requirements.
Upvotes: 2
Reputation: 2658
Let me answer both your questions:
This is mostly due there's no time synchronization between the users in the player and that's not an easy task.
First of all let's consider what happens when a user starts a video at some time UTC:
This is more or less what happens, no matter what kind of streaming it is.
So now when some other users, some seconds later, starts the same stream - they will open the same chunk (since that's the "newest") and start with the same keyframe, but this time it's already some seconds old.
The 4 seconds you're observing mean that ustream chunks are probably that exact length.
I must state that I never tried synchronising video between multiple users but I did argue once with a colleague that it's possible and here's the approach I'd take:
Then if all goes well, all your users will see the video at exactly the same time (or at least below the 40 ms of a single frame duration).
Upvotes: 1