# My stream lags/buffers/loads constantly for my viewers, but why?



## Jack0r (Aug 28, 2014)

To answer this question we first have to ask another one: Are "we" dropping frames?



If your view while streaming differs from the example above (meaning, dropped frames are being counted) you will want to see this thread: *Dropped frames/disconnecting/lag? Read this first!*
But often you will not drop frames and still have viewers moaning about lags or buffering or the stream constantly loading. Why is that and what can we do against it? First of all let us take a look at the "why":

*Why does my stream lag/buffer/load for my viewers?*
In the picture below we see two different Streaming providers. *Provider A* has no(or does no) balancing of its streams. This either means the provider sends all streams to the viewers of the server you streamed to or of a central server. (Twitch.tv seems to do this and uses its SanFrancisco server). As you can see in the example this can lead to the result that *User Z* can watch your stream just fine, either because the route from your Provider to him is very fast or no server on the route is overloaded. But *User X* might experience problems. He could live in the same country as you live but if the route between him and the provider is too long or is overloaded for some reason he might have problems watching your stream.


*Provider B* on the other hand has different servers all around the world (youtube for example I guess) and thus can send the stream within their own system to their servers. Now if any of these servers is near to *User Y* or the route between *User Y* and the balance server is fine, he will be able to watch your stream without buffering.

There are probably more ways for your Streaming provider to handle the streams, but this was just meant as a rough explanation. A *provider C* might use a combination of both systems, etc.

Now before we come to the, what can I do part, there is one more reason why your viewers might see buffering:
*YOU USE TOO MUCH BITRATE...*​Sorry, but that has to be written in caps. Streamers tend to use as much bitrate as they have upload available. Of course, I understand you want your stream to look good. But what does it help if your viewers need so much download speed that they are unable to watch it. RTMP streaming in special but also other streaming methods often rely on a single connection. This is different to a torrent download for example which can use several connections to get the "file".
So even while your speedtest might say you can download at 20mb/s constantly, this might not be true for a single connection. And the same goes for your viewers. Just because you can upload 20mb/s constantly without dropping a frame, it does not mean they will be able to download it. Even your stream provider will struggle to deliver that to several people. (Twitch.tv probably added their limits for those reasons, and money of course)

In the end while your 1080p 60fps 9mb/s stream might look glorious, and 3 people can watch it fine, either your stream provider or the rest of your possible viewers (so about 5.999.999.997 people) will probably not be able to experience the same. And this leads us to the, what can we do?

*What can we do?*
There is unfortunately no perfect cure for this. Let me make it clear once more: Unless you drop frames, the stream you send out arrived at the server of your provider. From this point it is *between the provider and your viewer*s.

But we have a few options we can try:

Lower your bitrate (and if necessary resolution/framerate)
Try different servers of the same Provider (will probably not help)
Try a different Provider (might have a better balancing)
Accept that some viewers can encounter problems
Lower your bitrate (and if necessary resolution/framerate)
It can also depend on the time of day, or on the usage amounts of your Provider if your viewers can watch the stream fine on day A but not on day B.

*The End*
The Internet is a big amount of highways connected with junctions, at each of the junctions, something can possibly go wrong. We can only make sure to use reasonable values and not drop frames. Then it is on our providers to do the best they can.


----------



## Sapiens (Aug 28, 2014)

my hero


----------

