Ugacomp

How can I enable Adaptive Bitrate streaming in Ant Media Server?

Where necessary, you may need to have access to a VPS server so you can follow how to implement the steps in this article.  You can get a cheaper VPS Server from Contabo with 4vCPU cores, 8GM RAM, and 32TB Bandwidth for less than $5.50 per month. Get this deal here now

Table of Contents

Cloud VPS S

$5.50 Monthly
  • 4 vCPU Cores | 8GB RAM

CLOUD VPS M

$15.50 Monthly
  • 6 vCPU Cores | 16GB RAM

CLOUD VPS L

$17.50 Monthly
  • 8 vCPU Cores | 24GB RAM

Traditionally, video streaming servers had to deliver fixed bitrate streaming and there was no alternatives like the availability of dynamic multi-bitrate transcoding. And if your target audience’s network connection was poor, they could experience buffering problems, something that always led to poor viewing experiences for them. To solve this issue, engineers came up with intelligent algorithms that support a technique called Adaptive Bitrate Streaming (ABR)

So, what is Adaptive Bitrate Streaming?

By definition, Adaptive bitrate streaming (ABR) is a technique used to deliver video streaming content over the internet in a way that adjusts to the user’s internet connection speed and device capabilities.

If your live streaming server supports ABR, the video player automatically adjusts the quality of the video being played to match the available network bandwidth. If the network connection is slow, the video player will switch to a lower-quality stream, which requires less bandwidth, to prevent buffering or stalling. If the network connection improves, the player will again automatically switch to a higher-quality stream for a better viewing experience.

This process is done by the video player detecting the available bandwidth and device capability and requesting the appropriate stream from the streaming server. The server delivers multiple versions of the same video file at different bitrates, resolutions, and codecs. The video player selects the appropriate version based on the user’s internet connection and device capability.

Platforms like YouTube use this same technique to enable their users to enjoy a seamless video streaming experience with limited buffering problems even if they there is poor network connection from their end

YouTube supports a range of resolutions up to 8K

Adaptive bitrate streaming ensures that your streaming audience will receive a consistent and uninterrupted viewing experience regardless of their network connection or device capability. It helps to eliminate buffering, stalling, or freezing during video playback, leading to a better user experience.

Does Adaptive Bitrate Stream use Transcoding?

Adaptive Bitrate Streaming typically involves video transcoding, which is the process of converting a video file into multiple versions based on certain metrics like bitrates and resolutions.

Transcoding itself involves two processes:

  • Transrating: This involves converting video or audio bitrate to a certain rate. For example, a video file with a high bitrate can be converted to a lower bitrate.

  • Transizing: This involves resizing the video resolution. In this process, a video resolution can be converted from high to low. For example, a 1080p video can be resized to a 720p resolution.

During the process of transcoding, multiple versions of the same video file are created at different bitrates, resolutions, and codecs, something that enables ABR to employ its intelligent logic.

How does Adaptive Bitrate Streaming work in Ant Media Server?

Ant Media Server supports Adaptive Bitrate Streaming (ABR) by using HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH) protocols. Ant Media Server achieves ABR by encoding the video at different bitrates and resolutions and creating multiple versions of the same video stream.

To enable ABR in Ant Media Server using HLS, the server transcodes the video into multiple renditions at different bitrates and resolutions. The server then generates an HLS manifest file that lists all the available renditions and their URLs. The HLS client, such as a web browser, selects the best quality rendition based on the available bandwidth and device capabilities at the end-users’ level.

Similarly, to enable ABR using DASH, the server transcodes the video into multiple bitrates and resolutions and generates a DASH manifest file that describes the available video renditions and their URLs. The DASH client, such as a web browser, selects the best rendition based on the available bandwidth and device capabilities.

How much computing power does Ant Media Server need to use Adaptive Bitrate Streaming?

As we know it by now, Adaptive Bitrate Streaming requires transcoding to compress the original video file into multiple lower-quality versions, each optimized for a specific bandwidth range.

Now, the amount of computing power required for ABR can vary depending on several factors, including the complexity of the encoding and transcoding algorithms used, the size and resolution of the video, the number of simultaneous streams, and the hardware capabilities of the streaming server.

The hard truth is, the ABR process is computationally intensive and requires a high-performance server or cloud infrastructure with specialized hardware, such as Graphics Processing Units (GPUs).

Do you really need a GPU for Ant Media server to activate ABR?

In the context of video streaming, GPUs are often used for tasks such as video transcoding, which involves converting video files from one format to another, and video encoding, which involves compressing video data for transmission over a network.

These tasks are highly parallelizable and require complex mathematical operations, which makes GPUs well-suited for such workloads. GPUs can handle large amounts of data in parallel and are optimized for processing video data, resulting in faster and more efficient video streaming.

On the other hand, CPUs are more versatile and can handle a wider range of tasks, including video streaming, but they may not be as efficient or fast as GPUs when it comes to video transcoding and encoding.

Now, the number of CPU cores needed to match the performance of a single GPU for video streaming would depend on the specific tasks being performed, the characteristics of the CPU and GPU being compared, and the quality and complexity of the video being streamed.

Which AWS GPU-optimized instances are good for Adaptive Bitrate Streaming?

Here is a table of some of the GPU-optimized instances you can find on AWS for your advanced Ant Media streaming setup. These instances offer tremendous computing power that you could need to support resource-intensive activities like encoding and transcoding.

Instance TypeGPU TypeGPU MemoryvCPUMemory (GiB)Network Bandwidth (Gbps)Storage (GB)
g4dn.xlargeNVIDIA Tesla T416 GiB416Up to 25EBS-Only
g4dn.2xlargeNVIDIA Tesla T416 GiB832Up to 25EBS-Only
g4dn.4xlargeNVIDIA Tesla T416 GiB1664Up to 25EBS-Only
g4dn.8xlargeNVIDIA Tesla T416 GiB3212825EBS-Only
g4dn.12xlargeNVIDIA Tesla T416 GiB4819250EBS-Only
g4dn.16xlargeNVIDIA Tesla T416 GiB64256100EBS-Only
g4dn.metalNVIDIA Tesla T416 GiB96384100EBS-Only
p3.2xlargeNVIDIA V10016 GiB86112EBS-Only
p3.8xlargeNVIDIA V10064 GiB3224425EBS-Only
p3.16xlargeNVIDIA V100128 GiB6448825EBS-Only

To warn you in advance, AWS GPU-optimized instances are not cheap, and can drain your wallet so fast than you can imagine. “If you’re not so sure about what you’re doing”, it’s important to avoid them during the process of setting up your live streaming server.

How to activate Adaptive Bitrate Streaming (ABR) on Ant Media Server?

Adaptive Bitrate Streaming feature only ships with the enterprise edition of the Ant Media server. If you’re using the community version of the software, you won’t be able to access it.

To activate ABR in your Ant Media, you need to follow the following steps:

Log in to your Web Panel

Once your enterprise license is active, all you need is to login to your admin web panel of the Ant Media server using the appropriate credentials you have.

Go to the target Streaming app settings

Ant Media server comes with two default streaming applications named: LiveApp and WebRTCAppEE. See the image below:

The settings of each application work independently of the other. In other words, Ant Media gives you the ability to trigger adaptive bitrate streaming functionality and other settings only customized to one streaming application and not necessarily on the other.

You can configure the ABR feature by clicking on the target application where your streams are set up. Then, you need to click settings as seen in the image below:

Define various bitrates of your streams

Here, you’re going to tell Ant Media’s ABR algorithm to create various versions of each video stream based on your predefined metrics like resolutions, Frame Rate, and Bitrates. See the image below:

Setting up various bitrates In Ant Media for Adaptive Bitrate Streaming functionality

It’s important to note that, the more resolutions and video bitrates you define, the more computing power this feature is likely to consume from your server. While, Adaptive Bitrate streaming can be critical to providing your viewers with a smooth streaming experience, you will need to be careful when triggering it as this could result in high resource (CPU & RAM) consumption on your server.

More Ant Media Server articles to explore

Hire us to handle what you want

Hire us through our Fiverr Profile and leave all the complicated & technical stuff to us. Here are some of the things we can do for you:

  • Website migration, troubleshooting, and maintenance.
  • Server & application deployment, scaling, troubleshooting, and maintenance
  • Deployment of Kubernetes, Docker, Cloudron, Ant Media, Apache, Nginx,  OpenVPN, cPanel, WHMCS, WordPress, and more
  • Everything you need on AWS, IBM Cloud, GCP, Azure, Oracle Cloud, Alibaba Cloud, Linode, Contabo, DigitalOcean, Ionos, Vultr, GoDaddy, HostGator, Namecheap, DreamHost, and more.
 

We will design, configure, deploy, or troubleshoot anything you want. Starting from $10, we will get your job done in the shortest time possible. Your payment is safe with Fiverr as we will only be paid once your project is completed.