AWS for M&E Blog

Introducing the Live Event Framework: Live Streaming with Ad Insertion on AWS

Video platforms are increasingly using advertising for monetization, both in free-to-air and subscription-based services. The latter often now offer ad-supported pricing models, allowing users to access content at a discounted subscription price in exchange for viewing ads. Implementing ad insertion into a live streaming platform requires careful planning and integration with multiple systems (including video players, content delivery networks (CDNs), the content origin and the publisher’s ad decision system).

At Amazon Web Services (AWS) we’ve worked with many customers from the early investigation stages of server-side ad insertion (SSAI) through to production. From this experience, we identified several lessons and common patterns. This presented an opportunity for automation.

We created an infrastructure as code approach using the AWS Cloud Development Kit (AWS CDK), to create a repeatable pattern for setting up customer proof of concepts (POCs) and test platforms. We are publishing the project as part of our AWS CDK MediaServices Reference Architectures on GitHub.

The Live Event Framework (LEF) simplifies the initial deployment of multiple services for live streaming events on AWS, creating a functioning end-to-end system in under 15 minutes. It comes pre-configured with AWS Elemental MediaTailor to support SSAI for large scale live streaming events. In addition, it includes sample video content containing SCTE markers and a basic ad decision server (ADS). This setup allows you to quickly test ad insertion concepts, saving valuable time and resources.

Benefits of the Live Event Framework

  • Speed: Deploys a multi-service live streaming architecture including sample content within minutes
  • Consistency: Ensures uniform setup across different live streaming events
  • Community Collaboration: Receive questions and updates from the community
  • Efficiency: Reduces deployment time and minimize configuration errors
  • Flexibility: Customize channel configurations to meet specific event requirements
  • Periodic Updates: Maintenance and updates as new features or updated recommendations are released
  • Security: Utilizes mechanisms to limit access to intended egress points only. LEF is built to be compatible with the Secure Media Delivery at the edge on AWS solution

As your testing evolves, you can customize your setup to focus on your specific environment and integrations. Examples of these incremental changes are:

  1. Replace our pre-configured content with your own to validate ad signalling
  2. Modify adaptive bitrate streaming (ABR) and resolutions to match your platform
  3. Migrate from the basic ADS we’ve included to a commercial offering to test decisioning against your own campaigns
  4. Iterate testing to validate personalization from client devices through the use of player parameters

The framework allows you to make incremental changes to understand and evaluate parts of the complex SSAI workflow without the need to start from the beginning.

A Tiered Architecture

The live event framework groups components into three tiered stacks. The purpose and hierarchy of these stacks is summarized in the following:

  • Foundation Stack
  • Event Group Stack
    • Purpose: Deploys resources for a subset of channels
    • Frequency: Typically, once per region; however, running multiple event groups is supported
    • Key Components: AWS Elemental MediaPackage Channel Group, Amazon CloudFront Distribution, and an AWS Elemental MediaTailor Configuration
    • Dependency: Relies on the Foundation Stack
  • Event Stack
    • Purpose: Deploys resources for a single channel or event
    • Frequency: Once per channel or event
    • Key Components: AWS Elemental MediaLive Channel and MediaPackage Channel
    • Dependency: Relies on both Foundation and Event Group Stacks
A diagram showing the three tiers deployed by the live event framework, as described in the preceding text. The Foundation Stack is shown on the bottom. The Event Group Stack sits above that with the Event Stack on top.

Figure 1: The Live Event Framework is based on a multi-stack architecture.

Under the Hood

The LEF architecture design places a CloudFront distribution in front of the MediaTailor configuration. All player interactions, including session initialization, manifest, media segments, ad segments, and tracking requests, are made through this distribution.

A high-level workflow diagram showing the video source on the left, feeding MediaLive. The MediaLive output is pushed to a MediaPackage Channel group. MediaTailor is shown to connect to and use MediaPackage as its video origin. Mediatailor also has a separate connection to a VAST Endpoint acting as an ADS. A sample web player on the far right of the diagram represents users connecting through CloudFront to access manifests from MediaTailor and content from MediaPackage.

Figure 2: The service architecture deployed by the Live Event Framework.

LEF deploys MediaPackage V2 resource types. In V2, MediaPackage introduced the concept of channel groups. A channel group is given a unique hostname which is shared across all channels placed within the group. This design suits the infrastructure as code approach utilized in the project. However, MediaPackage Live V1 channels are not supported by LEF.

In June 2024, MediaTailor introduced Common Media Application Format (CMAF) support to its dynamic transcode process, reducing the need for custom transcode profiles and making deployment more straightforward. MediaTailor will now detect when the content source is CMAF or ISOBMFF in a MPEG DASH or Apple HLS stream and dynamically transcode the ad creatives to match the program source with no additional user configuration required.

MediaTailor provides two options for tracking and reporting ad viewership:

  1. Server-side ad tracking, where MediaTailor sends ad tracking reports directly to the tracking URL
  2. Client-side ad tracking, where the client player performs ad tracking and sends beacons to the ad server

The type of reporting used for the session depends on how the playback request is initiated by the player. LEF supports both reporting models.

Getting Started with LEF

Since the Live Event Framework deploys all of the required AWS media services for you to get started, no prior knowledge of these is necessary. Prerequisites and full deployment instructions are documented in the project readme notes.

To begin using the Live Event Framework:

  1. Set up your AWS environment and install the AWS CDK
  2. Clone the AWS CDK MediaServices Reference Architecture repository from GitHub and navigate to the LEF folder
  3. Optionally configure your encoding parameters or stick with the project defaults
  4. Deploy the stacks in order:
    1. Foundation
    2. Event Group
    3. Event
  5. Confirm the SNS Email subscription sent to the email address entered as part of the foundation stack deployment
  6. Start the deployed MediaLive Channel
  7. Use the provided test player to validate video playback and that adverts are being inserted. Refer to the testing section of the project readme notes for instructions on how to obtain the streaming URLs and player details

Conclusion

The Live Event Framework (LEF) offered by AWS provides a powerful and streamlined approach to building an environment that accelerates MediaTailor Ad Insertion testing and integration with other AWS services. By leveraging the AWS CDK and a tiered stack approach, LEF simplifies the process of setting up multiple services, along with validating consistency and efficiency across multiple live streaming channels. This allows you to focus on critical SSAI integration points, such as your Ad Decision Service, reporting, and client SDKs.

To get started, visit the LEF project in the aws-samples GitHub repository and experience faster, more efficient live streaming with ad insertion on AWS.

Contact an AWS Representative to know how we can help accelerate your business.

Further Reading

Visit the following link to learn more about monetization workflows on AWS:

Andrew Fayle

Andrew Fayle

Andrew is a Senior Solution Architect, specializing in AWS Media Services in Australian and New Zealand. He has spent more than ten years building and operating large scale OTT solutions in the Telecommunications industry before joining AWS. Andrew now focuses on enabling customers to build innovative solutions making the most of AWS Elemental Media Services.

Christer Whitehorn

Christer Whitehorn

Christer is a Principal Solutions Architect on the World-Wide Media and Edge team at AWS. With over two decades of experience in the media technology sector, he has established himself as an expert in multiscreen video delivery, broadcast playout systems, and compression headend solutions. He is passionate about helping customers optimize their media workflows, improve operational efficiency, and enhance viewer experiences through cloud-based technologies.