Case Study of Netflix Video Compression Strategy

Pradeep
5 min readJun 12, 2024

--

Per-title Encode Optimization — 2015

The above bitrate and resolution is something netflix came up with around 2010, they called it one fits all, encoding techinque where they believed for a video streaming if we the resolution videos on the given bit rates we could achieve a high quality streams, however on plotting the PSNR plots some titles reach very high PSNR (45 dB or more) at bitrates of 2500 kbps or less. On the other extreme, some titles require bitrates of 8000 kbps or more to achieve an acceptable PSNR of 38 dB. Given this diversity, a one-size-fits-all scheme obviously cannot provide the best video quality for a given title and member’s allowable bandwidth.

In 2015, netflix published an article where they discussed about the encoding of videos per titles after a lot of research on various videos to find their optimal encoding rate, the reason being encoding the videos on titles because there might be titles having very involved action scenes that need more bits to encapsulate the information versus unchanging landscape scenes or animation that need less. This allowed them to deliver the same or better experience while using less bandwidth.

To deliver the best quality video to their members, each title should receive a unique bitrate ladder, tailored to its specific complexity characteristics. The encoding team at Netflix invested significant research and engineering to investigate and answer the following questions:

  • Given a title, how many quality levels should be encoded such that each level produces a just-noticeable-difference (JND)?
  • Given a title, what is the best resolution-bitrate pair for each quality level?
  • Given a title, what is the highest bitrate required to achieve the best perceivable quality?
  • Given a video encode, what is the human perceived quality?
  • How do we design a production system that can answer the above questions in a robust and scalable way?

A Large-Scale Comparison of x264, x265, and libvpx — a Sneak Peek — Aug 2016

Netflix works on improving our video compression efficiency to ensure that they are good stewards of the Internet while at the same time delivering the best video quality to our members.

What is a codec?

A codec is a hardware- or software-based process that compresses and decompresses large amounts of data.

Results

On august 2016, Netflix performed analysis on x264, x265 and libvpx codecs on a large scale on 3 resolutions (480p, 720p and 1080p) to find which is gives a better compression results and it is found that x265 and libvpx are both more efficient than x264 at compressing video, with savings of up to 50% at higher resolutions. x265 generally outperforms libvpx, except at 1080p where the difference is less pronounced.

More Efficient Mobile Encodes for Netflix Downloads — Dec 2016

In this blog, they summarize their work on generating more efficient video encodes, especially targeted towards low-bandwidth Internet connections. They refer to these new bitstreams as our mobile encodes. They are introducing two new types of mobile encodes — AVCHi-Mobile and VP9-Mobile. The enhancements in the new bitstreams fall into three categories:

  1. new video compression formats — H.264/AVC High profile and VP9
  2. more optimal encoder settings — optimizing encoder settings allows us to further improve compression efficiency.
  3. per-chunk bitrate optimization — the video source is split up into a number of chunks, each of which is processed and encoded independently.

All the changes combined result in better video quality for the same bitrate compared to our current streams (AVCMain).

Dynamic optimizer — a perceptual video encoding optimization framework — Mar 2018

  1. Shot encoding
  2. Chunked encoding
  3. Per-title and per-chunk encode optimization

Optimized shot-based encodes: Now Streaming! — 2018

In many cases, low bandwidth networks or data caps prevent netflix from delivering the perfect picture. To address this, the Netflix Video Algorithms team has been working on more efficient compression algorithms that enable Netflix to deliver the same or better picture quality while using less bandwidth.

The Dynamic Optimizer analyzes an entire video over multiple quality and resolution points in order to obtain the optimal compression trajectory for an encode, given an optimization objective. Dynamic Optimizer required encoding with different resolutions and qualities (QPs), requiring an order of magnitude more complexity. Second, we transitioned from encoding video chunks of about a few minutes long, to video encodes on a per-shot basis. Eg: 1 hr episode is divided into 20 3min chunks, each chunk has a lot of shot with average length of shot being 4 secs. Thus an 1hr episode will have like 900 shots to handle this complexity two methods collation and checkpoints were introduced.

Collation — we collate shots together, so that a set of consecutive shots make up a chunk.

Checkpoints — to ensure that each encoded shot and associated metadata are stored immediately after completion.

AV1 at Netflix — Oct 2019 → Nov 2021

Working of AV1 — Andrey Norkin & Liwei Guo — AV1 at Netflix

As of Noc 2021, netflix is streaming AV1 to TVs and mobiles. Some of the challenges faced by them are,

  1. What is the best AV1 encoding recipe for Netflix streaming?
  2. How do we guarantee smooth AV1 playback on TVs?
  3. How do we roll out AV1 encoding at Netflix scale?
  4. How do we continuously monitor AV1 streaming?

Reference

  1. https://netflixtechblog.com/per-title-encode-optimization-7e99442b62a2
  2. https://netflixtechblog.com/a-large-scale-comparison-of-x264-x265-and-libvpx-a-sneak-peek-2e81e88f8b0f
  3. https://netflixtechblog.com/more-efficient-mobile-encodes-for-netflix-downloads-625d7b082909
  4. https://netflixtechblog.com/dynamic-optimizer-a-perceptual-video-encoding-optimization-framework-e19f1e3a277f
  5. https://netflixtechblog.com/optimized-shot-based-encodes-now-streaming-4b9464204830
  6. Netflix Research
  7. Andrey Norkin & Liwei Guo — AV1 at Netflix
  8. https://netflixtechblog.com/bringing-av1-streaming-to-netflix-members-tvs-b7fc88e42320
  9. https://netflixtechblog.com/toward-a-practical-perceptual-video-quality-metric-653f208b9652
  10. https://netflixtechblog.com/high-quality-video-encoding-at-scale-d159db052746

--

--

Pradeep

Machine Learning Engineer @Glance. An inquisitive learner with an Integrated Master’s in Data Science from PSG Tech, 2021.