Exploring AWS Elemental MediaPackage: Video Packaging and Delivery

Christopher Adamson
5 min readSep 18, 2023

--

AWS Elemental MediaPackage is a cloud-based video origination and packaging service that allows you to securely deliver live and on-demand video to a wide variety of devices. In this article, we’ll explore how MediaPackage can be used to prepare and deliver video for streaming.

Getting Started with MediaPackage

To use MediaPackage, you first need to create a MediaPackage channel. The channel defines the video source and packaging configurations. For example, you can specify an incoming live video stream as the source, along with HLS and DASH packaging settings.

Once the channel is created, you can create endpoints to deliver the packaged video. Endpoints represent the final streaming destinations and URLs for playback on devices. You can configure endpoints for features like DRM encryption, access control, and more.

Some key benefits of MediaPackage include:

  • Just-in-time packaging — Video is packaged into streaming formats when requested, so you don’t need to pre-package assets. This saves storage and reduces latency.
  • Built-in redundancy — MediaPackage is fully managed and provides redundancy. The service is designed to reliably deliver video without any loss.
  • Scalability — You can scale the capacity of channels and endpoints up and down to handle changes in viewership. MediaPackage will automatically adjust capacity to optimize cost and performance.
  • Security — MediaPackage supports DRM encryption, access control, and other security features to protect your video content throughout the delivery workflow.

Packaging Live Video Streams

For delivering live video, MediaPackage makes it easy to take streams from encoders and package them for delivery to streaming players.

You can ingest live video from encoders in raw formats like RTMP or TS over UDP. MediaPackage will package the video in HLS or DASH on-the-fly and provide the output streaming manifests and segments.

To deliver a live stream, you create a channel and endpoint configured for your live video source and packaging requirements. MediaPackage will process the incoming stream and provide the endpoints for playback.

You can also configure features like DVR windows and SLATE graphics for live channels. This allows viewers to pause and playback the live stream on-demand. The live stream is continually packaged and made available for playback within the DVR window duration.

Packaging and Protecting Video On Demand

In addition to live streams, MediaPackage can package and deliver video on demand assets. You upload your VOD content to an S3 bucket and create a MediaPackage VOD asset that references the object.

When a playback request comes in, MediaPackage will pull the object from S3, package it into streaming formats, and provide the output manifests and segments to the player.

MediaPackage supports features like DRM encryption, access control, and authorization to secure your VOD content throughout the delivery process. You can encrypt VOD content with CMAF packaging to support playback across devices.

You can also rotate encryption keys or limit access to certain users or devices. MediaPackage gives you full control over who can access and playback your packaged VOD content.

Monitoring and Logging

MediaPackage provides monitoring and logging capabilities to track metrics and debug issues with your video delivery channels and endpoints.

You can view logs and metrics for events like errors, viewer requests, capacity changes, and more. MediaPackage also integrates with CloudWatch for additional monitoring, alarms, and reporting.

The detailed visibility helps you monitor streaming delivery performance and identify any issues that may occur. This is especially useful for optimizing and troubleshooting production live streams.

Tutorial on using AWS Elemental MediaPackage for video packaging and delivery

AWS Elemental MediaPackage allows you to securely delivery video content to viewers on a wide range of devices. In this tutorial, we’ll walk through how to use MediaPackage to package and deliver a video on demand asset.

Prerequisites

  • An AWS account
  • A video file uploaded to an S3 bucket
  • Basic understanding of AWS services

Step 1 — Create a MediaPackage VOD Asset

First, we’ll create a MediaPackage VOD asset that will reference our source video file in S3.

1. Go to the MediaPackage console and click “Assets” in the left menu.

2. Click “Create” to add a new VOD asset.

3. Give the asset a name and specify the S3 bucket and object key of your source video file.

4. Click “Create” to add the asset.

Step 2 — Create a Packaging Group

Next, we need to create a packaging group that defines how our video will be packaged.

1. Go to “Packaging groups” in the left menu and click “Create”.

2. Select an output format, e.g. “CMAF” for DASH and HLS.

3. Specify an S3 bucket for the packaged output.

4. Click “Create” to add the packaging group.

Step 3 — Create a Packaging Configuration

Now we can create a packaging configuration that applies the packaging group to the VOD asset.

1. Go to “Packaging configurations” and click “Create”.

2. Select the VOD asset and packaging group you created.

3. Click “Create” to add the packaging configuration.

Step 4 — Create an Endpoint

Finally, we need an endpoint that will provide the streaming manifests and video segments.

1. Go to “Endpoints” and click “Create”.

2. Select “Apple HLS” and/or “DASH” as the endpoint type based on your packaging output.

3. Click “Create” to add the endpoint.

Step 5 — Play the Packaged Video

To play the video, we can use the endpoint URL in a video player. MediaPackage will package and deliver the video on-the-fly.

And that covers the basic workflow for packaging a VOD asset with MediaPackage! You can now extend this with other features like DRM, access control, and more.

Examples of the AWS CLI commands to follow the MediaPackage tutorial:

This uses the AWS CLI to create the MediaPackage resources following the steps outlined in the tutorial. The result would be a packaged VOD asset ready for playback!

Conclusion

AWS Elemental MediaPackage provides a robust, cloud-based solution for preparing and delivering video for streaming. The service handles the complex aspects of video packaging while providing flexibility and scalability.

Key features like just-in-time packaging, built-in redundancy, and dynamic scaling allow MediaPackage to reliably support both live and on-demand video workloads. You can customize packaging configurations and security controls to meet your specific video delivery needs.

MediaPackage integrates seamlessly with other AWS services like CloudWatch, S3, and CloudFront to enable complete video workflows. The service can be managed entirely through AWS tools like the console, CLI, and APIs.

For video providers looking to reach viewers across devices, MediaPackage is an ideal choice. The service eliminates the need to build and maintain your own packaging and origination infrastructure. With MediaPackage, you can focus on creating great video content and let AWS handle the delivery powering your streaming service.

--

--