Please wait while we enable your Account

0%

Contacting Amazon Web Services
Deploying Cloud Servers, Storage, Transcoding & Database Servers
Deploying Global CDN
Deploying Firewall & Enabling Security Measures
Deploying the CMS & Admin Module
Deploying Website, Mobile & TV Apps framework
Creating your FTP account
Finishing up all the modules
Preparing for launch

“Per-title Encoding” or “Adaptive Bitrate Encoding” – What Is It And How Is It Used?

Tanmaya Patra Published on : 31 May 2023
Understanding Per-Title Encoding and Adaptive Bitrate Encoding

We know that different types of videos need different bitrates and encoding settings to achieve the best quality. Per Title Encoding, also called Adaptive Bitrate Encoding, helps in achieving this objective.  

In contrast to classic encoding techniques, where the same encoding ladder is used for all types of content, Per Title Encoding can decrease the storage and delivery costs of video streams significantly. 

Using Adaptive Bitrate Encoding, easy-to-encode videos can be delivered with much lower bitrates and improved perceptual quality. 

In addition, videos involving movies or sports, which involve a lot of movement, are streamed at lower resolutions to avoid a bad video streaming quality at the user’s end.

Important: 

There is no practical implementation process or help articles available on the internet explaining how to implement the “Per-Title process”. So there are so many blogs that only explain it theoretically. So I implemented some theoretical approaches (out of many approaches) into Muvi Encoding.

How to Calculate the Video Quality or Noise Ratio of the Video?

How to Calculate the Video Quality or Noise Ratio of the Video?

There are 3 ways to calculate the Video Quality or Noise Ratio of a video:

  1. VMAF (Video Multimethod Assessment Fusion)
  2. PSNR (Peak signal-to-noise ratio)
  3. SSIM (Structural similarity index measure)

Note: We will go with the PSNR way of calculating video quality.

What is PSNR and How Is It Calculated?

For a video, we usually try to calculate how much noise or pixel corruption was introduced after video compression, in case the compression is essentially lossy (mainly due to Quantization).

A simpler way to compute that will be to calculate the noise quantity of a specific video with a tool. And then using the noise quantity, we will estimate the Quality.

For example:

We have an original video: sample_movie.mp4

After Per-Title Encoding, (In this case, we will reduce bit rates for PerTitleEncoding)

  1. 1080 Encoded video: sample_movie_1080.mp4 
  2. 720 Encoded video: sample_movie_720.mp4
  3. 360 Encoded video: sample_movie_360.mp4

Now to find each one’s quality we need to produce the same resolution videos from the original video without reducing the bitrate and then compare with (1, 2, and 3).

FFMPEG Command: (Compare 2 Videos to get a Noise/PSNR quality Index comparison)

code

How to get a Noise/PSNR quality Index comparison

Types of Per Title Encoding

According to most of the theoretical blogs, there are essentially two types of per-title or adaptive bitrate encoding. 

  1. Selecting a Bitrate Ladder and Encoding Profile
  2. Analyzing the Complexity of a Video and Compress Video’s Bitrates

Let’s take a look at these two types one by one.

1. Selecting a Bitrate Ladder and Encoding Profile

This process depends on certain encoding and transmission parameters, that can be varied on a Per Title basis. Some of these parameters are:

  • The resolutions chosen in the bitrate ladder: Some titles might be able to produce great quality videos at 720p itself. So, for those titles, we might not have to produce a 1080p resolution video for higher quality content. 
  • The bitrate chosen for each resolution: Choosing the bitrate is the most important part of the per-title encoding. Suppose, in case you are forced to produce a set of video resolutions (1080p, 720p, etc.), you can still vary the bitrates for each of these resolutions. That is, instead of producing 1080p at 6mbps, you can actually produce 1080p at 3mbps and still achieve the same video quality. 
  • The number of profiles in the bitrate ladder: This is again a huge benefit of the Per Title Encoding process. By mixing and matching the bitrate–resolution combinations, you can easily reduce the number of profiles you will need to produce in the bitrate ladder initially. 

Our Suggestion:

We are trying to integrate this Process currently. Till now, we are able to save a considerable amount of space through this process. So this process is working well for us!

2. Analyzing the Complexity of a Video

If you ask me what is the most important aspect of Per Title Encoding, I would say it is really important to “understand” a movie’s complexity. And by complexity, we mean the complexity of all its scenes, the variations involved in it, etc. 

One way to understand this complexity is to gather sufficient information, data, and stats about the scenes of the movie. And then use that data to compress it.

And this necessity to relate the complexity of a movie to its compression process leads us to Multi-Pass Encoding. In Multi-Pass Encoding, the first passes (or N passes) are used to gather information about the movie. In the final M passes, the video is encoded using the collected information.

What sort of information are we looking for to understand a movie’s complexity? 

We will need the following information:

  • Global speed or motion vectors: The global motion vectors tell us how fast the scenes are moving. This data can be used to distinguish between a talk show (where usually people do not move much) and an NFL game (that involves tons of fast-paced motion and camera movements).
  • Spatial complexity: Spatial complexity helps us understand whether a majority of the frames are filled with plain-colored blocks (like in the Simpsons) or are filled with complex patterns (like in period dramas).
  • Temporal Complexity: This data is somewhat related to the global speed vectors. It helps us understand how quickly the movie’s content is changing from one frame to another.

So, the global speed or motion vectors, spatial complexity, and temporal complexity are really important video characteristics. They can determine how well a video can be compressed given a certain budget. 

And most importantly, they help us know the nature of the video pretty well. And, if you know the nature of the video, you can set the right encoding settings and get the best video quality very easily, if asked to compress that video to some X Mbps.

In Multi-Pass encoding, another pass is performed on the video to compress it to the correct bitrate as determined by the convex hull, after gathering all this information in the first pass.   

Advantages of Per-Title Encoding

Per Title Encoding has multiple advantages. Some of them are listed below.

  • Storage Savings: Per Title Encoding helps you save a lot of space as you can compress the video very well by varying the bitrate and resolutions on a per-title basis.
  • Transmission Savings: It will help you save a good amount of CDN delivery costs, as each title will be encoded using a bitrate ladder that suits it the most. 
  • Lower Buffering: Due to efficient compression, the end-user will now download smaller files. Hence, there will be lesser incidences of buffering and minimize start-up delays.
  • Saving Encoding Time: Since the bitrate ladder will be tuned for every movie individually, the overall encoding time will reduce drastically. This is because the drop in resolution will increase the encoder’s speed. Also, the motion estimation and compensation algorithms will have to do less work due to reduced resolution.
  • Improved Quality: In this process, we are actually fine-tuning the encoder, resolution, bitrate, frame rate, and other settings on a per-movie or per-title basis. So, we will be able to extract optimal results out of the encoder to get the best quality videos.

Hence, the benefits of Per Title Encoding will ultimately lead to a great viewer experience!

Also, by the Per Title Encoding, you will save a lot on storage, CDN costs, and encoding time.

Drawbacks of Per Title Encoding

Some of the drawbacks of this process are:

  1. It needs a major investment in engineering time.
  2. It is 20 times more expensive than other encoding methods.
  3. Per Title optimization is very slow.

To Sum Up

Per Title encoding helps us achieve the best video quality by tweaking the bitrate, resolution, and encoding settings. In this way, we can save a considerable amount of storage space, transmission costs, and encoding time, and reduce the buffering of videos to a bare minimum. 

Muvi Free Trial CTA

Written by: Tanmaya Patra

Tanmaya Patra is a skilled Full stack Software Engineer at Muvi, specializing in PHP, React, Hybrid app development, Docker, and Linux. He plays a pivotal role in the company's Video/Audio Encoding Department, conducting extensive research and engineering cutting-edge solutions. With a passion for technology and a meticulous approach to problem-solving, he consistently delivers innovative solutions that meet and exceed client expectations.

Add your comment

Leave a Reply

Your email address will not be published.

Try Muvi One free for 14 days

No Credit Card Required

.muvi.com
Your website will be at https://yourname.muvi.com, you can change this later.

Upcoming Webinar
May 08

9:00AM PST

Scale on Demand: Muvi’s Application Scalability Insights

Scalability in applications means that as more people start using the app or as the app handles more data, it continues to perform well without crashing or slowing…...

Event Language: English
30 Minutes