Published on

Challenge of Distributing Live Video

Authors

How do you serve a high-quality live video and audio feed to tens of thousands of users at the same time? Look through the process of taking a single feed and adapting it for all.

Step-by-step: How Live Streams Work

  1. A video feed is sent to a server compatible with RTMP.
  2. This server transcodes the feed in realtime to a client-friendly format
  3. Clients periodically request the next chunk of media and receive it

Well, if it's as simple as 1-2-3, then why would I be writing an article about it?

Problem 1: Transcoding Fast Enough

Most of the live streaming industry just uses FFmpeg under the hood. FFmpeg is a most excellent piece of open-source software that enables you to easily record, convert, and stream audio and video. The issue is not with FFmpeg itself, but rather the way it is deployed and amount of resources allocated to it. If for any reason your transcoding process is not able to use the resources it needs (possibly because it is receiving too many requests,) you may start to drop frames.

Problem 2: Caching and Scaling

Caching and cache invalidation are some of the most difficult functions in computing. For live video and audio data, caching is uniquely challenging. The size of this data presents an issue, depending on your server resources, you might not have enough memory to store content long enough to prevent overloading the transcode server with additional requests.

Problem 3: Bandwidth

If you've solved the other two issues and start to find balance, bandwidth usage might be the thing that sneaks up on you. Whether you are oversaturing a shared unmetered connection or blowing through your limited bandwidth usage quota, it will add up quickly. Running your own networks at internet exchange points and interconnecting directly with ISPs is a way to solve this issue but is reserved for companies that already have some scale.

Learn more

Sign up for our newsletter

Get Started