AWS for M&E Blog

Optimize for sustainability with video encode reuse in AWS Elemental MediaLive

Amazon Web Services (AWS) customers are increasingly aware of energy consumption and carbon footprint associated with IT and media workflows. They seek guidance about how to reduce unnecessary resource usage. For customers looking to optimize AWS architecture for energy efficiency, we offer the Sustainability Pillar of the AWS Well-Architected Framework. The Sustainability Pillar provides design principles, operational guidance, best-practices, potential trade-offs, and improvement plans to meet sustainability targets for your AWS workloads.

In this blog post, we highlight how to apply best practices and guidance established in the Sustainability Pillar to media workflows for encoding of video and audio. Specific examples are highlighted to demonstrate how live video encoding workflows are configured to reduce energy use by sharing encodes within AWS Elemental MediaLive where possible. It’s possible to share an encode among several identical outputs instead of encoding once per output.

The AWS Shared Responsibility Model for sustainability in the cloud. The Customer is responsible for sustainability In the cloud; including Data Design & Usage, Software Application Design, Platform Deployments & Scaling, Data Storage, Code Efficiency, and lastly Utilisation & Scaling. AWS is responsible for sustainability Of the cloud; including servers, cooling, water, waste, data centres, electric supply and building materials.

Environmental sustainability is a shared responsibility between AWS and customers

AWS is focused on efficiency and continuous innovation across our global infrastructure, as we continue on our path to powering our operations with 100% renewable energy by 2025. AWS is committed to achieving Amazon’s goal of net-zero carbon by 2040.

AWS is responsible for optimizing the sustainability of the cloud – delivering efficient, shared infrastructure, water stewardship, and sourcing renewable power.

Customers are responsible for sustainability in the cloud – optimizing workloads and resource use, and minimizing the total resources required to be deployed for your workloads.

Live video encodes

AWS Elemental MediaLive is a broadcast-grade live video processing service that creates high-quality streams for delivery to broadcast TVs and internet-connected devices. The service is used by thousands of companies and individuals to encode/transcode live video streams for different delivery application types, such as those described in Back to basics: HTTP video streaming.

As is explained in depth in Back to basics: Mechanisms used behind the scenes in video compression, the main purpose of video compression is to reduce the volume of data needed to capture, store, and transmit video. Applying advanced and computationally demanding encoding algorithms results in reduced requirements for storage hardware, data transmission time, and bandwidth to deliver high-quality video over the internet.

Finding opportunities to reuse encodes can avoid redundant processing, which can then reduce the amount of energy required to complete the encoding task.

Different use cases require different encoding profiles, and it’s sometimes necessary to create multiple copies of the same encoded video/audio output stream. This may be required in systems where the same video is output multiple times with different audio languages and commentaries, in systems where the same streams are fed to different locations, or where multiple MediaLive output types are required (e.g. archive, transport stream (ts), HTTP Live Streaming (HLS), Microsoft Smooth Streaming (MSS) and others).

The default way to create multiple output streams is to encode video/audio streams once for each output. However, this increases the overall processing within MediaLive, which results in more energy consumption and therefore a larger carbon footprint. Instead, it’s a best practice to reuse output streams where possible. The ability to reuse the same output stream from a single encode process can result in reducing overall energy consumption, which aligns with best practices from the Sustainability Pillar.

In the following section, we describe how to configure the reuse of output streams using the AWS Management Console.

How to configure reuse of encode processing

MediaLive provides a simple and intuitive way of reusing video and/or audio resources, referred to as “sharing existing encode”. The following steps with screenshots from the console explain how this can be configured. This example uses an existing video encode, and the same functionality also applies to audio and caption tracks (if applicable).

Step 1 – Create a MediaLive channel and create an output group. Configure the original output stream within your first output group:

Screenshot of MediaLive configuration of the output group settings

Screenshot of MediaLive configuration of the output group settings

 

Step 2 – Create a second output group. This time, instead of configuring the video component, click Remove video and then click Add video. From the drop down, choose the video listed under Use one of the following video encodes. In this example, we select Video: video_original (H.264, 1920×1080) where ‘video_original’ is the Video Description Name used in Step 1.

Screenshot of MediaLive configuration showing selection of; Use one of the following video encodes

Screenshot of MediaLive configuration showing selection of Use one of the following video encodes

 

Step 3 – From the pop-up dialogue box called Use an existing video encode, ensure the Share the existing encode option is selected and click Confirm.

Screenshot of MediaLive configuration showing selection of; Share the existing encode.

Screenshot of MediaLive configuration showing selection of Share the existing encode

 

The new video stream becomes a copy (a ‘shared video stream’) of the first video stream, which means the video transcode processing is performed only once for both outputs. In this example, the amount of underlying compute units needed by MediaLive to encode live outputs is reduced from two to one because MediaLive is able to reuse the data from the first output in the second output.

This design approach aligns with several of the Sustainability Pillar best practices, including using the minimum amount of hardware to meet your needs, using managed services, and removing or refactoring workload components with low or no use.

Screenshot of the MediaLive console showing the output is considered a Shared video stream.

Screenshot of the MediaLive console showing the output is considered a Shared video stream

 

Note that reusing a component in this way means that changes made to either output group component are automatically updated on the other output group. This is very convenient as there is no need to make the same changes multiple times, which also ensures the configuration of these output streams remains identical. It is also important to note that the reuse of encodes does not result in a lower cost as MediaLive charges are incurred per output.

Additional Sustainability Pillar best practices

There are other Sustainability Pillar best practices not covered in depth in this blog. For example, the choice of an AWS Region can impact the carbon footprint of the workload based on the carbon intensity of the local energy grid and the proximity to an Amazon renewable energy project. Read more within the Sustainability Pillar about how to Choose Region based on both business requirements and sustainability goals and explore using one of the 19 AWS Regions where the electricity consumed was attributable to 100% renewable energy in 2022. Another example where Sustainability Pillar considerations should inform part of the design choice is when selecting between the use of standard or single-pipeline channels for media flows. Standard pipeline channels provide higher availability by using redundant MediaLive processing in two separate Availability Zones (AZs). Note that the higher availability is at the tradeoff of higher cost and effectively doubling the amount of encoding resources required in the channel.

Reference Architecture

A reference architecture to build this configuration using the AWS Cloud Development Kit (CDK) can be found in this AWS Samples GitHub repository.

In this example, we share an encode output across AWS Elemental MediaPackage and AWS Elemental MediaConnect output groups.

Teardown

Please remember to stop or remove any MediaLive channel not in use to avoid unnecessary resource and energy use.

Conclusion

The reuse of encodes is ideal when dealing with systems where multiple copies of the same video and/or audio components are needed. It is convenient to make changes as all components copied are automatically updated. Also, importantly, by reusing encodes instead of encoding multiple times, overall processing and energy consumption can be reduced.

Now that you have a better understanding of the concept of reusing video encodes in MediaLive, we encourage you to apply this knowledge in your own AWS video workflows.

Hein Nergaard

Hein Nergaard

Hein Nergaard, Senior Specialist Solutions Architect. Hein has over 23 years of experience in Media & Broadcasting. He is advising our M&E customers how to implement their cloud and on-premises solutions, specialising in AWS Elemental Media Services.

Jason O'Malley

Jason O'Malley

Jason O’Malley is a Sr. Partner Solutions Architect at AWS supporting partners architecting media, communications, and technology industry solutions. Before joining AWS, Jason spent 13 years in the media and entertainment industry at companies including Conan O’Brien’s Team Coco, WarnerMedia, and Media.Monks. Jason started his career in television production and post-production before building media workloads on AWS. When Jason isn’t creating solutions for partners and customers, he can be found adventuring with his wife and son, or reading about sustainability.

Roman Chekmazov

Roman Chekmazov

Sr. Solution Architect for AWS Elemental