AWS for M&E Blog

Getting optimal video quality using AWS Elemental Statmux: A content-aware approach

If you are a content or service provider delivering video over fixed bandwidth infrastructure (such as satellite, cable, or terrestrial networks), you continuously look for ways to fit as many programs as possible in your statistical multiplexing (statmux) system without compromising the video experience delivered to customers. Statmux, which has been in use for over 20 years, distributes available bandwidth over a number of channels depending on their complexity. It allocates higher bandwidth to more complex channels and lower bandwidth to less complex ones, thereby achieving better video quality across all channels compared to simply dividing the fixed total bandwidth evenly among a number of channels.

Amazon Web Services (AWS) recently released Statmux improvements for AWS Elemental appliances and software, including AWS Elemental Statmux (Statmux), an on-premises software and appliance solution for processing live video channels, and Statmux for AWS Elemental MediaLive, which lets you prepare and share live broadcast video, using AWS Elemental MediaLive. In this blog, we go over the Statmux algorithm enhancements introduced and highlight the benefits in achieving video quality improvements.

Next-generation Statmux algorithm

A typical statmux system continually analyzes the video scene complexity (derived based on spatial and temporal activity statistics) of each channel and dynamically allocates the bitrate based on this analysis. This approach does not consider the perceptual nature of the content. Why allocate bits to a channel if the viewer is not able to perceive the benefits? To improve bitrate allocation, we take a page from the AWS Elemental Quality-Defined Variable Bitrate (QVBR) rate-control algorithm, based on the concept of context-aware encoding, and extend its use for the new AWS Elemental Statmux algorithm. Now, the bitrate allocation is driven by perceptual models that adapt to the encoded content with the objective of maintaining consistent quality among all channels in a Statmux group. This results in better overall video quality and bandwidth efficiency than the previous approach.

In the new Statmux algorithm, each encoder prepares and sends estimated bitrates for 10 QVBR quality levels while considering the minimum and maximum bitrates as capping values. These assignments are perceptually weighted using a module (similar to what is available in QVBR), referred to as content classification, where the content is analyzed for visual perception. The content classification module, which is quite accurate at predicting the visual perception across content, was developed using machine learning (ML) with an extensive training set. The Statmux bitrate controller loops through the quality levels versus predicted bitrate data set for all channels to find the quality level that gives the closest rate to the group bandwidth. An example of this can be seen in Figure 2 (a) where the Statmux bitrate controller decides, based on the available bandwidth for the six high definition (HD) Statmux groups, on a target quality level of 5.5 for all channels. This context-aware approach achieves better quality equalization among the channels by considering perceptible video quality when allocating bandwidth.

This perceptual approach has been extended to handle use cases where the Statmux group contains different resolutions, such as HD and standard definition (SD), different frame rates, and different codecs (AVC and HEVC or AVC and MPEG-2). Great care has been taken to fine-tune the quality levels versus bandwidth allocation for the different codecs because each codec has a different quality versus bandwidth profile.

Alt text: High level architectural diagram of an AWS Elemental Statmux solution showing channels encoded using AWS Elemental Live and output as an MPTS

Figure 1. The new AWS Elemental Statmux solution

If you need to prioritize your premium channels in a Statmux group, video quality can now be controlled using a priority-setting feature, which ranges from -5 to +5, with 0 as the default and 5 as the highest priority level. When the priority level is set, the quality levels and their respective target bitrates will be adjusted to reflect that priority. For instance, as shown in Figure 2 (b), the priority for channel 5 was set to +5, so the quality level for this channel is increased, leading to more bandwidth allocation. In this case, the multiplex bitrate controller chose a target quality level of 7 for channel 5 while the other channels received a target quality level of 4.7. Further, Figure 2 (c) shows another use case where priorities for channels 3 and 4 were set to -3 and -2, respectively. Note that the quality levels for these channels were adjusted down to 3.5 and 4, respectively, while the other default channels received a target quality level of 5. With the priority setting, the multiplex bitrate controller balances the video quality based on the assigned priority level for each channel.

Three examples of setting different priority levels for channels in a Statmux group, and the effect it has on bitrate for each channel

Figure 2. Example of quality level assignment for (a) default priority for all channels; (b) a high priority channel; (c) a mix of high priority and low priority channels

Performance comparison

Consider a Statmux system composed of nine SD channels using the MPEG-2 codec in a total pool of 18 Mbps. The content for the channels varies from complex sports and concert scenes to simple talking heads sequences. As shown in Figure 3, the new Statmux algorithm reduced the bitrate distribution of channels 1 through 6 in favor of the more complex channels 7 and 8. What is the impact of this revised bandwidth distribution on the video quality of the new Statmux solution? As indicated in Figure 4, the average peak to signal noise ratio (PSNR) for channel 7 increased by 1.3 dB while the average PSNR for the other channels slightly increased. For PSNR values, the higher the value, the better the video quality. The major contribution to video quality is observed when we look at the minimum PSNR. Note the major increase in the minimum PSNR for the new Statmux algorithm, which translates into improvements in video quality.

Distribution graph of bitrates across nine Standard Definition channels showing improvements in the new Statmux algorithm compared to the previous version for MPEG-2

Figure 3. MPEG-2 9 SD Statmux system bandwidth distribution

Average and minimum PSNR graphs showing improvements in the new Statmux algorithm compared to the previous version for the nine Standard Definition MPEG-2 channels

Figure 4. MPEG-2 9 SD Statmux system video quality performance

Let us also consider another Statmux system with five AVC High Definition (1080i 30) channels with a total of 17.5 Mbps bandwidth (refer to Figures 5 and 6). The content for the channels in the Statmux group is composed of (1) various Olympic sports, (2) a drama series, (3) another drama series with more action, (4) a documentary program with outdoor scenes, and (5) a hockey game. Note the increase in allocated bitrate with the new Statmux algorithm for channels 2, 3, and 5, which led to improved average PSNR across these channels. In addition, channel 3 had an increase in the minimum PSNR of 3 dB due to the improved visual quality around dark scenes. Though the minimum PSNR was slightly reduced for channel 5, there was no visual impact. Regarding the challenging content in channels 1 and 4, even though these were allocated less bandwidth, their visual outputs look very similar to those generated using the previous Statmux algorithm.

Distribution graph of bitrates across five High Definition channels showing improvements in the new Statmux algorithm compared to the previous version for AVC

Figure 5. AVC 5 HD Statmux system bandwidth distribution

Average and minimum PSNR graphs showing improvements in the new Statmux algorithm compared to the previous version for the five High Definition AVC channels

Figure 6. AVC 5 HD Statmux system video quality performance

A third example looks at the use case where a mix of nine SD and two HD channels are included in a Statmux group with a total of 21 Mbps. The previous Statmux algorithm, as illustrated in Figure 7, allocated less bandwidth for the HD channels while the new Statmux algorithm prioritized these channels by reducing bandwidth to the SD channels. The revised bandwidth allocation facilitated by the new Statmux algorithm resulted in much better video quality for the two HD channels, as indicated by Figure 8. Note the 2 dB increase for the average PSNR for the HD channels at a slight reduction in the average PSNR for the SD channels, where once again the visual impact for the SD channels was very minimal. The new Statmux algorithm has a much better visual quality balance between all the channels in the Statmux group.

Distribution graph of bitrates across a mix of two High Definition and nine Standard Definition channels showing improvements in the new Statmux algorithm compared to the previous version for AVC

Figure 7. AVC SD/HD Statmux system bandwidth distribution

Average and minimum PSNR graphs showing improvements in the new Statmux algorithm compared to the previous version for the mix of two High Definition and nine Standard Definition AVC channels

Figure 8. AVC SD/HD Statmux system video-quality performance

Summary

By using QVBR technology, AWS Elemental Statmux delivers perceptually balanced quality and improves the viewer experience compared to the previous generation statmux. Content or service providers that need to further optimize the efficiency of their statmux solutions are encouraged to consider AWS Elemental Statmux for on-premises use and Statmux for AWS Elemental MediaLive for the cloud to take advantage of the latest Statmux algorithms.

Ali Jerbi

Ali Jerbi

Principal Product Manager, Video Quality

Anouar Hadj Taieb

Anouar Hadj Taieb

Anouar is a Principal Software Development Engineer with AWS Elemental.