How does Netflix streams and onboards new content.

We are seeing constant wars between OTTs, revenue from the OTT industry continues to grow at an unprecedented rate, and it’s expected to reach $316.40bn in 2024. Meanwhile, the global OTT video market size is expected to top $476 billion by 2027.

90% of people are consuming OTT platforms.

Source: https://www.uscreen.tv/blog/ott-statistics/

Netflix positioned for continual dominance, armed with over 50,000 individual titles, 200million subscribers in 180+ countries, even more impressive is the underlying technology powering this growth. My goal is to scratch more than the surface of how Netflix operates, digging deeper into the technicalities of the end-to-end processes involved in delivering content at scale.

This diagram shows an overview of the system we will be discussing in this article.

Article content

Content King

Netflix has a combined library of over 50,000 titles, supporting over 2200 devices, each device with its resolution and network speed. To support so many devices at different network speeds, they definitely need to have the original video in different format.

Netflix receives video content from production houses in the highest quality possible. However, the files are extremely large, particularly for a 2-hour movie on a commercial blu-ray, which can be between 15-25GB. Distributing such large files to users would significantly consume data and bandwidth. Therefore, Netflix undertakes a series of preprocessing procedures on the original videos to convert them into various file formats. These procedures, known as Encoding and Transcoding, are essential for optimizing the content for streaming.

When dealing with video and audio files, encoding involves compressing the data to make it compatible with a specific device. On the other hand, transcoding allows data that has already been encoded to be converted to a different format such as MP4, WLM, MOV, or MPEG-4. This process is particularly handy for users who utilize various devices like mobile phones and web browsers, which may not all support the same formats or have limited storage capacity. The reasons for carrying out this preprocessing are quite straightforward.

  • Reduce file size.
  • Reduce buffering for streaming video.
  • Change resolution or aspect ratio.
  • Change audio format or quality.
  • Convert obsolete files to modern formats.
  • Make a video compatible with a certain device (computer, tablet, smartphone, smartTV, legacy devices).
  • Make a video compatible with certain software or service.

Compressing a 25Gb movie will take a lot of time, to solve this problem. Netflix breaks the original video into different smaller chunks and using parallel workers in AWS EC2, it performs encoding and transcoding on these chunks converting them into different formats (MP4, MOV, etc) across different resolutions(4k, 1080p, and more).

Netflix also creates multiple replicas of the same video chunk to cater to different network speeds. About 1300 replicas of a video chunk.

Example

-High Quality ------4K,1080p,720p,360p -Medium Quality ------4K,1080p,720p,360p -Low Quality ------4K,1080p,720p,360p

Netflix stores all these processed video data on Amazon S3.Which is a highly scalable and available storage platform for storing static data. Each video file is stored in chunks of scenes.

Netflix uses AWS for nearly all its computing and storage needs, including databases, analytics, recommendation engines, video transcoding, and more—hundreds of functions that in total use more than 100,000 server instances on AWS.

https://aws.amazon.com/solutions/case-studies/netflix

By default, most chunks of video are set to 10 seconds. When you skip to different parts of a movie, Netflix's Playback API is queried for different video chunks. Typically, one chunk is actively playing, another is prepared to play once the current chunk is finished, and a third chunk is already downloaded. This process ensures a seamless viewing experience for the user and maximizes speed at any given moment.

The arrival speed of these segments determines the bit rate, which refers to the number of bits used per second, for the subsequent segments.

Article content

If the first segment takes longer than the playback duration of the chunk, it will select the next lower bitrate segment for the following one. Conversely, if it arrives faster, it will opt for a higher resolution segment, if one is available. This is why, on occasion, your video may initially appear grainy and then adjust to a better definition.

Netflix has users in over 200 countries. If a user in Nigeria wants to watch a movie on an amazon instance hosted in America. The internet service providers will need to travel to America to access those servers which will take time and bandwidth. In an era where fractional delays in serving content can lead to declines in revenue, it is paramount that users get access to the content fast. Netflix solved this problem by creating mini servers inside ISPs and IXP(internet exchange points) known as open connect. These boxes are capable of storing 280 terabytes of data. After the videos have been compressed and transcoded on Amazon S3 they are then transferred to these open connect boxes during an off-peak period (Let's say 4 am). When the user requests for a video instead of hitting Netflix servers directly in the US. It hits the open connect boxes. This ensures less bandwidth, faster playtime, and ultimately a better user experience. Movies can also be localized depending on the region. You could store different movies on the open connect appliances in Nigeria and Brazil. About 90% of Netflix content is served this way.

Open Connect

A CDN is a geographically distributed group of services that work together to provide fast delivery of internet content. Open Connect is Netflix’s custom global content delivery network (CDN). Everything that happens after you hit play on a video is handled by Open Connect.

  • Open Connect stores Netflix video in different locations throughout the world. When you press play the video streams from Open Connect, into your device.
  • Netflix has been in partnership with Internet Service Providers (ISPs) and Internet Exchange Points (IXs or IXPs) around the world to deploy specialized devices called Open Connect Appliances (OCAs) inside their network. Open Connect Design Image from Netflix

Article content

  • These servers periodically report health metrics optimal routes they learned from IXP/ISP networks and what videos they store on their SSD disks to Open Connect Control Plane services on AWS.
  • When new video files have been transcoded successfully and stored on AWS S3, the control plane services on AWS will transfer these files to OCAs servers on IXP sites. These OCAs servers will apply cache fill to transfer these files to OCAs servers on ISP's sites under their sub-networks.
  • When an OCA server has successfully stored the video files, it will be able to start the peer fill to copy these files to other OCAs servers within the same site if needed.
  • Between 2 different sites which can see each other's IP address, the OCAs can apply the tier fill process instead of a regular cache fill. Open Connect Transfering content from Netflix

Article content

Conclusion

In summary:

  • Netflix performs compression and transcoding of the original video file.
  • The file is split into chunks using parallel workers in AWS for faster processing.
  • Each chunk is subdivided across several resolutions and internet speeds.
  • These chunks are stored on Amazon S3.
  • During the off-peak period. The files are transferred to open connect boxes, which is Netflix's custom content delivery network spread out across the world.
  • These boxes are capable of communicating and sharing content between themselves.

Building OTT platform? You got the know-how. Want to know more about the tech stack Netflix uses? I will posting about it soon at my profile next week. Follow me Rohan Girdhani for more tech insights.

♻️ Enjoyed this? Repost with you network. Let the learning flow.