Tutorial: Automated ABR With AWS Elemental MediaConvert
Per-title encoding has been around since 2016, delivering significant bandwidth savings, QoE improvements, or both to companies that deploy it (click here for a backgrounder on per-title encoding). Those benefits notwithstanding, a recent Bitmovin survey revealed that only 35% of respondents were currently utilizing this technique, which is also called content-aware encoding and other similar names. Perhaps it’s a perception that per-title encoding is too difficult to implement. If so, this tutorial is for you. I’ll demonstrate how simple it is to produce per-title output using AWS Elemental’s Automated ABR (adaptive bitrate) function.
To be clear, there are many excellent implementations of per-title encoding out there, such as Microsoft Azure, Brightcove, Bitmovin, Tencent, and others. However, AWS does the best job of making its per-title functionality available—with most options—via AWS Elemental MediaConvert’s highly polished user interface, which makes it perfect for easy experimenting and articles like this. As with all other services, most production encoding with MediaConvert is performed via an application programming interface (API), not via the GUI.
With this background behind us, let’s start with a look at the status quo: a fixed bitrate ladder.
The Limitations of Fixed Bitrate Ladders
All ABR technologies use encoding ladders to create an array of files that are appropriate for different playback devices and connection speeds. Figure 1 (below) shows the suggested H.264 encoding ladder from Apple’s HLS (HTTP Live Streaming) Authoring Specification.
Figure 1. A fixed encoding ladder from Apple’s HLS Authoring Specification
While having a suggested ladder as a starting point is incredibly useful, even Apple acknowledges that this ladder isn’t appropriate for all content: “The above bit rates are initial encoding targets for typical content delivered via HLS. Apple recommends that you evaluate them against your specific content and encoding workflow, then adjust accordingly.”
That said, to harvest the full benefit of per-title encoding, it’s not just bitrates you need to adjust; it’s also the number of rungs and their resolution. Videos with fine detail and fast motion (think soccer) are hard to encode and need high data rates to achieve acceptable quality. Videos with less detail or lower motion (think news readers) are easy to encode and can achieve acceptable quality at much lower bitrates. Other classes of videos still, like synthetic videos (think cartoons or screencams), combine low motion and precise detail and encode best at higher resolutions.
With the most effective per-title techniques, you upload your file, and the system evaluates motion, detail, complexity, and other factors to create a unique encoding ladder for each video, adjusting the number of rungs, their resolutions, and bitrates to optimize quality and file size.
That’s the pitch, anyway. Read on to see how you do it with MediaConvert.
About AWS Elemental MediaConvert
MediaConvert actually features two per-title-ish technologies (the descriptions are from AWS):
- Quality-Defined Variable Bitrate (QVBR): “QVBR analyzes every macroblock, frame, and scene in the video source, and automatically allocates bits to address information differences: higher bitrate use during complex video segments, and lower bitrate use during less complex video segments.”
- Automated ABR Configuration: This “allows MediaConvert to pick the ideal rendition configuration based on a content classification analysis performed during the encoding process ... leveraging Quality-Defined Variable Bitrate (QVBR) mode in MediaConvert to optimize the bitrate efficiency of each rendition.”
In use, with QVBR, you create a fixed encoding ladder as normal and select QVBR for bitrate control instead of constant bitrate or variable bitrate. MediaConvert adjusts the bitrate of each rung to match the content—but not the number of rungs or their resolution—during encoding.
With Automated ABR Configuration, you upload the file, and MediaConvert analyzes it and creates a unique encoding ladder for that file, customizing the number of rungs and their resolutions. Then it relies on QVBR to choose the data rate for each rung.
We’ll be experimenting with Automated ABR Configuration, and let’s jump in. I’m going to presume that you’re familiar with MediaConvert operation; if not, Amazon’s brief Getting Started With AWS Elemental MediaConvert tutorial should get you up-to-speed.
Choosing the ABR File Group
To begin, log in to MediaConvert, and click Create Job. In the Job interface on the left, click Add to add an Output group of files. This opens the dialog shown in Figure 2 (below).
Figure 2. Adding an Output group
Choose one of the bottom four outputs (you can’t use Automated ABR to output a file group), then click Select.
Choose Automated ABR
Just beneath the Apple HLS group settings dialog, you’ll see an option for Automated ABR. Enable that as shown on the top in Figure 3. Note the pricing message at the top of Figure 3 (below); when you use Automated ABR, MediaConvert implements two-pass quality-optimized encoding, which is the most expensive technique.
Figure 3. Choosing and configuring your Automated ABR options
As you can see on the bottom of Figure 3, you can insert the name modifier that MediaConvert will add to the file name.
Choosing Your Automated ABR Options
Next, select your Automated ABR options in reverse order (see Figure 3). That is, first choose the maximum and minimum data rates, and then choose the maximum number of renditions.
- Maximum ABR bitrate: This sets the upper data rate limit for your top-quality file. There are multiple strategies you can deploy here. If you care more about QoE than bandwidth savings, set this higher than the existing maximum rate in your fixed bitrate ladder. Hard-to-encode files will encode at a higher bitrate than before, improving quality, and the additional bandwidth will likely be offset by bandwidth savings from easy-to-encode files. If you care more about bandwidth savings, and you’re comfortable that your top existing rate delivers acceptable quality, then use the current top rate on your fixed bitrate ladder. You’ll save bandwidth on easy-to-encode files and break even on hard-to-encode files.
- Minimum ABR bitrate: Set the minimum bitrate that you want to deliver. Using the existing minimum on your fixed bitrate ladder is probably fine.
- Maximum renditions: Like all cloud encoding facilities, AWS Elemental charges for each rung produced. Particularly if you’re limiting your maximum bitrate to, say, 6Mbps, consider limiting the number of renditions to seven or eight. Of course, if you’re encoding 4K content, you’ll need more renditions.
Consider letting MediaConvert decide the appropriate number of rungs during your initial experimenting, and then specify a number to minimize costs, if appropriate, during production. See my article, Five Views of Your Encoding Ladder, for more information about optimal bitrate spacing for rungs in your encoding ladder.
Companies and Suppliers Mentioned