Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Guidance for Live Streaming on AWS

Summary: This implementation guide provides an overview of the Guidance for Live Streaming on AWS, its reference architecture and components, considerations for planning the deployment, and configuration steps for deploying the Guidance for Live Streaming on AWS to Amazon Web Services (AWS). This guide is intended for solution architects, business decision makers, DevOps engineers, data scientists, and cloud professionals who want to implement the Guidance for Live Streaming on AWS in their environment.

Overview

Amazon Web Services (AWS) lets broadcasters and content owners to seamlessly scale infrastructure to broadcast live content to a global audience. The Guidance for Live Streaming on AWS helps you build highly available live video streaming content using AWS Media Services and Amazon CloudFront that is highly resilient and secure to deliver real-time viewing experiences to your customers.

This Guidance provides the following features:

  • Encodes and packages your content for adaptive bitrate streaming across multiple screens via HTTP live streaming (HLS), Dynamic Adaptive Streaming over HTTP (DASH), and Common Media Application Format (CMAF) by automatically configuring AWS Elemental MediaLive and AWS Elemental MediaPackage.

  • Provides an elastic, highly available, global content delivery network for live video streaming using Amazon CloudFront.

You can deploy this Guidance and run it only during a live event and then delete the Guidance’s stack after the program ends, to ensure you only pay for the infrastructure that you use.

This implementation guide discusses architectural considerations and configuration steps for deploying Live Streaming on AWS in the AWS Cloud. It includes a link to an AWS CloudFormation template that launches and configures the AWS services required to deploy this Guidance using AWS best practices for security and availability.

The guide is intended for IT infrastructure architects, administrators, and DevOps professionals who have practical experience with video streaming and architecting in the AWS Cloud.

Use this navigation table to quickly find answers to these questions:

If you want to . . .Read . . .
Know the cost for running this Guidance. The estimated cost for running this Guidance in the US East (N. Virginia) Region is USD $69.49 per month.Cost
Understand the security considerations for this Guidance.Security
Know how to plan for quotas for this Guidance.Quotas
Know which AWS Regions are supported for this Guidance.Supported AWS Regions

Features and benefits

The Guidance for Live Streaming on AWS provides the following features:

Comprehensive output formats

Using AWS Elemental MediaPackage, this Guidance supports the standards and formats commonly used to stream video, such as CMAF, HLS, and DASH, for playback support on different media players.

Input redundancy

Using AWS Elemental MediaLive, this Guidance supports two input feeds and it’s ideal for customers looking to add redundancy to their live feeds.

MediaConnect support

The Guidance supports AWS Elemental MediaConnect inputs providing a high-quality transport service for live video.

Flexible video content protection

Using this Guidance, you can apply just-in-time content protection to secure your live streams by integrating with multiple Digital Rights Management (DRM) technologies. Protection capabilities are standards-based, including support for Apple FairPlay, Widevine, and Microsoft PlayReady using AES-128 encryption.

Integration with AWS Service Catalog AppRegistry and AWS Systems Manager Application Manager

This Guidance includes a Service Catalog AppRegistry resource to register the Guidance’s CloudFormation template and its underlying resources as an application in both AWS Service Catalog AppRegistry and AWS Systems Manager Application Manager. With this integration, you can centrally manage the Guidance’s resources.

Use cases

Streaming media

As consumer demand for video streaming increases, media and entertainment companies are looking for secure and reliable web-based video streaming alternatives to traditional television. With Live Streaming on AWS, customers can avoid inefficient trial-and-error approaches and save time and costs for their streaming media projects.

Concepts and definitions

This section describes key concepts and defines terminology specific to this Guidance: 

Adaptive Bit Rate (ABR)

A streaming method that adjusts the video quality based on network conditions to improve video streaming over HTTP networks.

HTTP Live Streaming (HLS)

HTTP-based streaming protocol to deliver media over the internet and developed by Apple Inc.

Dynamic Adaptive Streaming over HTTP (DASH)

HTTP-based streaming protocol (also known as MPEG-DASH) to deliver media over the internet and developed under MPEG (Motion Picture Experts Group).

Common Media Application Format (CMAF)

HTTP-based streaming and packaging standard to improve delivery of media over the internet, compatible with HLS and DASH, and co-developed by Apple and Microsoft. For a general reference of AWS terms, see the AWS glossary in the AWS General Reference.

Architecture overview

This section provides a reference implementation architecture diagram for the components deployed with this Guidance.

Architecture diagram

Deploying this Guidance with the default parameters deploys the following components in your AWS account.

Architecture diagram

Figure 1: AWS Architecture

The Guidance’s AWS CloudFormation template launches the AWS products and services necessary to ingest, transcode, and deliver live streaming video.

  1. AWS Elemental MediaLive ingests two input feeds and transcodes your content into two adaptive bitrate (ABR) HTTP Live Streaming (HLS) streams as output.

    Two feeds are ingested for MediaLive redundancy. Each MediaLive transcodes a single ingest feed into ABR outputs.

  2. AWS Elemental MediaPackage ingests the MediaLive ABR output and packages the live stream into HTTP Live Streaming (HLS), Dynamic Adaptive Streaming over HTTP (DASH) and Common Media Application Format (CMAF) formats that are delivered to three MediaPackage custom endpoints.

    These three formats were selected because that is what popular streaming devices support. MediaPackage is an origin server that prepares the content for delivery to phones, tablets, smart TVs, and other devices.

  3. An Amazon CloudFront distribution is configured to use the MediaPackage custom endpoints as its origin and includes a CDN Identifier custom HTTP header to authenticate requests. MediaPackage only fulfills playback requests that are authorized between MediaPackage and CloudFront using the CDN Identifier. This CDN Identifier is created as part of the CloudFormation deployment and securely stored in AWS Secrets Manager. For details, refer to the CDN Authorization in AWS Elemental MediaPackage in the _AWS Elemental MediaPackage User Guide_.

  4. The CloudFront distribution delivers your live stream to viewers with low latency and high transfer speeds.

  5. A demo HTML preview player is available to help you test the Guidance. The player is a static website hosted in an Amazon Simple Storage Service (Amazon S3) bucket. Amazon CloudFront is used to restrict access to the Guidance’s website bucket contents.

You can configure this Guidance to ingest Real-time Transport Protocol (RTP), Real-Time Messaging Protocol (RTMP), HTTP Live Streaming (HLS), or AWS Elemental MediaConnect flows. This Guidance also includes three encoding profiles.

Note: AWS CloudFormation resources are created from AWS Cloud Development Kit (AWS CDK) constructs

AWS Well-Architected

We designed this Guidance with best practices from the Well-Architected Framework, which helps customers design and operate reliable, secure, efficient, and cost-effective workloads in the cloud.

This section describes how we applied the design principles and best practices of the Well-Architected Framework when building this Guidance.

Operational excellence pillar

This section describes how the principles and best practices of the operational excellence pillar were applied when designing this Guidance.

The Guidance for Live Streaming on AWS tracks all assets via AWS CloudTrail, and logs from AWS Elemental MediaLive, MediaPackage, and Amazon CloudFront provide observability into the infrastructure and the rest of the Guidance components.

Security pillar

This section describes how the principles and best practices of the security pillar were applied when designing this Guidance.

To help reduce latency and improve security, Live Streaming on AWS includes an Amazon CloudFront distribution with an origin access identity, which is a special CloudFront user that helps restrict access to the Guidance’s website bucket contents.

AWS Elemental MediaPackage only fulfills playback requests that are authorized between MediaPackage and CloudFront using a CDN identifier. This CDN identifier is created as part of the AWS CloudFormation deployment and securely stored in AWS Secrets Manager. For more details, refer to the CDN authorization in AWS Elemental MediaPackage  in the AWS Elemental MediaPackage User Guide.

Reliability pillar

This section describes how the principles and best practices of the reliability pillar were applied when designing this Guidance.

The Guidance supports primary and secondary live streams throughout AWS Elemental MediaLive and AWS Elemental MediaPackage providing the redundancy that customers require for critical live video events.

Performance efficiency pillar

This section describes how the principles and best practices of the performance efficiency pillar were applied when designing this Guidance.

This Guidance uses AWS Elemental MediaLive, MediaPackage, and MediaConnect, which are currently available in specific AWS Regions only. If you use MediaConnect as input, you must deploy this Guidance in the same Region as your MediaConnect flows.

The Guidance for Live Streaming on AWS is automatically tested and reviewed by Guidance architects and subject matter experts for areas to experiment and improve.

Cost optimization pillar

This section describes how the principles and best practices of the cost optimization pillar were applied when designing this Guidance.

The cost for running this Guidance varies based on a number of factors, including the encoded profile selected, the bitrate of the live stream and the number of viewers.

Using Application Manager, customers can measure the efficiency of the workloads, and the costs associated with delivery.

Sustainability

This section describes how the principles and best practices of the sustainability pillar were applied when designing this Guidance.

To minimize the environmental impact of backend services, Live Streaming on AWS uses managed and serverless services. Customers can run this Guidance only during a live event and delete the stack after the program ends, thereby reducing the carbon footprint as compared to the footprint of continually operating on-premises servers.

Architecture details

This section describes the components and AWS services that make up this Guidance and the architecture details on how these components work together.

HTML preview player

A demo HTML preview player is available to help you test the Guidance. The player is a static website hosted in an Amazon S3 bucket. It is pre-populated with the URLs that point to the newly created customer stream. The HTML/JavaScript application plays back the HLS, DASH, MSS, and CMAF streams. In addition, the Guidance can be configured to ingest a Demo HLS feed hosted on AWS. Customize the HTML in the DemoBucket Amazon S3 bucket to suit your needs. For details about putting the HLS video into a webpage, refer to the Apache 2.0 Video.JS open-source project.

To check output on the player, start the AWS Elemental MediaLive channel. Even if you selected no for the Start MediaLive Channel CloudFormation template parameter, you can go to the MediaLive channel to start the player when you are ready to start testing.

URL_PULL (HLS) input configuration

URL_PULL provides the option to ingest an HTTP live streaming (HLS) stream over HTTP or HTTPS. The following parameters are required to configure the Guidance to ingest an HLS stream:

Source Input Type - URL_PULL.

Primary Source URL - The HTTP(s) link to the HLS stream manifest file. The default value is a demo stream from AWS.

Primary Source Username - Only required if you have basic authentication setup on your source HLS stream.

Primary Source Password - Only required if you have basic authentication setup on your source HLS stream.

Secondary Source URL - The HTTP(s) link to the HLS stream manifest file. The default value is a demo stream from AWS.

Secondary Source Username - Only required if you have basic authentication setup on your source HLS stream.

Secondary Source Password - Only required if you have basic authentication setup on your source HLS stream.

Encoding Profile - Select the profile that best matches your source resolution.

Start MediaLive Channel - If your device is ready to stream, select yes. Otherwise, select no — you can start the AWS Elemental MediaLive channel through the AWS Management Console when you’re ready to stream.

Note: For a full list of input types and configuration details, refer to the Creating an input topic in the _AWS Elemental MediaLive User Guide_.

RTMP_PULL input configuration

RTMP_PULL provides the option to ingest an RTMP stream. The following parameters are required to configure the Guidance to ingest an RTMP stream:

Source Input Type - RTMP_PULL.

Primary Source URL - The RTMP link to the primary source stream, for example rtmp://203.0.113.20:1935/primary.

Primary Source Username - Only required if you have basic authentication setup on your source stream.

Primary Source Password - Only required if you have basic authentication setup on your source stream.

Secondary Source URL - The RTMP link to the primary source stream, for example rtmp://203.0.113.20:1935/secondary.

Secondary Source Username - Only required if you have basic authentication setup on your source stream.

Secondary Source Password - Only required if you have basic authentication setup on your source stream.

Encoding Profile - Select the profile that best matches your source resolution.

Start MediaLive Channel - If your device is ready to stream, select yes. Otherwise, select no—you can start the AWS Elemental MediaLive channel through the AWS Management Console when you’re ready to stream.

Note: For a full list of input types and configuration details, refer to the Creating an input topic in the _AWS Elemental MediaLive User Guide_.

RTMP_PUSH and RTP_PUSH input configuration

RTMP_PUSH and RTP_PUSH provide the option to push a transport stream (TS) to AWS Elemental MediaLive. In both options, the following parameters are required to configure the Guidance:

Source Input Type - RTP_PUSH or RTMP_PUSH

Input Security Group CIDR Block - A valid CIDR block used to create a security group to restrict access to the MediaLive input.

Encoding Profile - Select the profile that best matches your source resolution.

Start MediaLive Channel - If your device is ready to stream, select yes. Otherwise, select no — you can start the MediaLive channel through the AWS Management Console when you’re ready to stream.

Note: For a full list of input types and configuration details, refer to the Creating an input topic in the _AWS Elemental MediaLive User Guide_.

MEDIACONNECT input configuration

MEDIACONNECT provides the option to ingest a stream from Elemental MediaConnect. The following parameters are required to configure the Guidance to ingest from MediaConnect:

Source Input Type - MEDIACONNECT.

Primary MediaConnect ARN - The ARN of the primary source stream, for example: arn:aws:mediaconnect:uswest1:111122223333:flow:1bgf67:primary. This MediaConnect flow must be in a different Availability Zone as the secondary stream.

Secondary MediaConnect ARN - The ARN of the secondary source stream, for example: arn:aws:mediaconnect:uswest1:111122223333:flow:1bgf67:secondary. This MediaConnect flow must be in a different Availability Zone as the primary stream.

Encoding Profile - Select the profile that best matches your source resolution.

Start MediaLive Channel - If your device is ready to stream, select yes. Otherwise, select no—you can start the AWS Elemental MediaLive channel through the AWS Management Console when you’re ready to stream.

Note: For a full list of input types and configuration details, refer to the Creating an input topic in the _AWS Elemental MediaLive User Guide_.

AWS services in this Guidance

AWS serviceDescription
AWS Elemental MediaLiveCore. It ingests two input feeds and transcodes your content into two adaptive bitrate (ABR) HTTP Live Streaming (HLS) streams as outputs.
AWS Elemental MediaPackageCore. It ingests the MediaLive ABR output and packages the live stream into HLS, Dynamic Adaptive Streaming over HTTP (DASH), and Common Media Application Format (CMAF) formats that are delivered to three MediaPackage custom endpoints.
Amazon CloudFrontCore. It uses the MediaPackage custom endpoints and its origin and includes a CDN identifier custom HTTP header to authenticate requests.
AWS Secrets ManagerCore. It stores securely the CDN identifier from Amazon CloudFront.
Amazon S3Core. It stores a demo HTML preview player to help you test the Guidance.
AWS Systems ManagerSupporting. Provides application-level resource monitoring and visualization of resource operations and cost data.

Plan your deployment

This section describes the cost, security, Region, and quota considerations for planning your deployment.

Cost

You are responsible for the cost of the AWS services used while running this live streaming Guidance. As of this revision, the cost for running this Guidance in the US East (N. Virginia) Region with:

  • Approximately 1,000 viewers for a one-hour live event using a standard definition (SD)-540p encoding profile is approximately $2.50 for live encoding and packaging + $67.24 for 791 GB distribution = $69.74 for the one-hour event.

  • Approximately 10,000 viewers for a one-hour live event using a high definition (HD)-1080p encoding profile is approximately $13.04 for live encoding and packaging + $1,492.56 for 18,017 GB distribution = $1,505.60 for the one-hour event.

  • Approximately 100 viewers for 200 hours live events each month using a high definition (HD)-1080p encoding profile is approximately $904.69 for live encoding and packaging + $2,934.00 for 36,035 GB distribution = $3,838.69 for the total of 200 hours each month.

These cost estimates depend on many factors, which are detailed in the following cost examples.

Note: The examples provided are likely higher than the actual costs of running this Guidance. The intent was to provide a guide to the pricing that is easily understood. Where assumptions were needed, we used factors that were straightforward to calculate and also likely be more expensive than the actual cost.

For an additional cost example for streaming a live event, refer to the FAQs about live streaming on AWS blog in the AWS Media Blog.

We recommend creating a  budget  through AWS CostExplorer  to help manage costs. Prices are subject to change. For full details, refer to the pricing webpage for each AWS service used in this Guidance.

Cost example 1

Cost example 1 covers a use case of approximately 1,000 viewers viewing a live event for about one hour with a SD-540p encoding profile selected in the CloudFormation template. This cost example is based on the following factors:

Pricing Region: us-east-1, assuming standard pricing (no free-tier or discounts)

Viewers consume the highest bitrate: Note that bitrate consumption is a mix of all the streams, but the highest bitrate is used in the calculation to show the upper cost range. Additionally, the Quality-Defined Variable Bitrate (QVBR) and variable video complexity can result in an output bandwidth that is 10-50% lower in price than the estimate provided in Table 1.

99% cache/hit ratio between the content delivery network (CDN) and AWS Elemental MediaPackage.

Note: Storage of the test player is not included in this cost estimate.

Table 1 summarizes the total pricing for the live streaming event. Tables 2 through 4 break down the cost for each AWS service.

AWS serviceFunctionCost per hour [USD]
AWS Elemental MediaLiveInput and outputs for channel$1.99
AWS Elemental MediaPackageIngest of channel$0.11
AWS Elemental MediaPackagePackaging and origination$0.40
Amazon CloudFrontDistribution$67.24
Total: $69.74/hour

Table 1: Cost breakdown for 1,000 viewers for a one-hour live event

AWS Elemental MediaLive pricing

Table 2 breaks down the AWS Elemental MediaLive pricing which assumes HD AVC input and SD AVC outputs with less than 10 Mbps bitrate and less than 30 frames per second (fps) frame rate.

Input / OutputCost per hour [USD]
HD Input (AVC 10-20Mbps)$0.234
Output 1 SD (512x288, 400k)$0.44
Output 2 SD (640x360, 800k)$0.44
Output 3 SD (768x432, 1200k)$0.44
Output 4 SD (960x540, 1800k)$0.44
Total:$1.99/hour

Table 2: MediaLive pricing

AWS Elemental MediaPackage pricing

MediaPackage charges $0.03 per Gigabyte (GB) per hour for standard Live ingest, based on the aggregate bitrate of all live input streams. This example has four input streams, so the rate of GB streaming per hour is determined by:

Adding the bitrate of all streams in either kbps or Mbps:

400k + 800k + 1200k + 1800k = 4200 kbps

0.4 + 0.8 + 1.2 + 1.8 = 4.2 Mbps

Convert kbps or Mbps to Gigabits (Gbit) per second. 1024 Mb = 1 Gbit.

4.2 Mbps / 1024 = 0.0041015625 Gbits ps

Convert Gbits to GB. 1 Gbit = 0.125 (or 1/8) GB

0.0041015625 Gbits ps * 0.125 = 0.0005126953125 GBps

Convert GB per second to GB per hour:

0.0005126953125 GBps * 60s * 60mins = 1.845703125 or 1.85 GB/hour

((sum of stream bitrates in Kbps) / 1024 [Mbps conversion]) / 1024 [Gbit conversion] * 0.125 [bits to Bytes conversion] * 60 seconds * 60 minutes = GB / hour

Input / Outputkbps
Output 1 SD (512x288, 400k)400
Output 2 SD (640x360, 800k)800
Output 3 SD (768x432, 1200k)1200
Output 4 SD (960x540, 1800k)1800
Total kbps4,200
Convert kbps to GB/hour (4,200 kbps / 8 (bits to bytes) / 1024 (kbps to Mbps) / 1024 (Mbps to Gbps) x 60 (seconds) x 60 (minutes)1.85 GB/hour
GB/hour with redundancy3.70 GB/hour
Cost (GB/hour * $0.03)$0.11/hour

Table 3: MediaPackage ingest pricing

AWS ServiceCost per hour [USD]
Total MediaPackage with 1% of egress (7.91 GB x $0.05)$0.40

Table 4: MediaPackage packaging and origin pricing

Note: We assume that MediaPackage serves 1% of the traffic to CloudFront and viewers, and the rest is served by CloudFront. Table 5 provides the 1% of egress for the MediaPackage estimate in Table 4.

Viewer traffic pricing

The cost estimate for viewer traffic assumes that all viewers get the highest bitrate for the one-hour live streaming event.

AWS ServiceFunctionTotal
Amazon CloudFrontAverage Mbps per viewer1.8
Amazon CloudFrontTotal MB per sec (1000 x 1.8 / 8)225
Amazon CloudFrontTotal Egress per hour (225 / 1024 x 60 x 60)791 GB/hour
Total cost (791 GB * $0.085): $67.24/hour

Table 5: Viewer traffic pricing

Cost example 2

Cost example 2 covers a use case of approximately 10,000 viewers viewing a live event for about one hour with an HD-1080p encoding profile selected in the CloudFormation template. This cost example is based on the following factors:

Pricing Region: us-east-1, assuming standard pricing (no free-tier or discounts)

Viewers consume the highest bitrate: Note that bitrate consumption is a mix of all the streams, but the highest bitrate is used in the calculation to show the upper cost range. Additionally, the QVBR and variable video complexity can result in an output bandwidth that is 10-50% lower in price than the estimate provided in Table 6

99% cache/hit ratio between the CDN and AWS Elemental MediaPackage

Note: Storage of the test player is not included in this cost estimate.

Table 6 summarizes the total pricing for the live streaming event. Tables 7 through 10 breaks down the cost for each AWS service.

AWS ServiceFunctionCost per hour [USD]
AWS Elemental MediaLiveInput and outputs for channel$3.75
AWS Elemental MediaPackageIngest of channel$0.28
AWS Elemental MediaPackagePackaging and origination$9.01
Amazon CloudFrontDistribution$1492.56
Total: $1,505.60/hour

Table 6: Cost breakdown for 10,000 viewers for a one-hour live event

AWS Elemental MediaLive pricing

Table 7 breaks down the AWS Elemental MediaLive pricing which assumes HD AVC input and both SD and HD AVC outputs with less than 10Mbps bit rate and less than 30fps frame rate.

Input / OutputCost per hour [USD]
HD Input (AVC, 10-20Mpbs)$0.234
Output 1 SD (512x288, 400k)$0.44
Output 2 SD (640x360, 800k)$0.44
Output 3 SD (768x432, 1200k)$0.44
Output 4 SD (960x540, 1800k)$0.44
Output 5 HD (1280x720p, 2700k)$0.88
Output 6 HD (1920x1080p, 4100k)$0.88
Total:$3.75/hour

Table 7: MediaLive pricing

MediaPackage ingest pricing

As detailed in Cost Example 1, MediaPackage pricing is based on GB ingested per second across all streams of live output. Table 8 shows the conversion from kbps to Mbps to Gbits/second to GB/hour.

Input / Outputkbps
Output 1 (512x288_400k)400
Output 2 (640x360_800k)800
Output 3 (768x432_1200k)1200
Output 4 (960x540_1800k)1800
Output 5 (1280x720p_2700k)2700
Output 6 (1920x1080p_4100k)4100
Total kbps11,000
Convert kbps to GB/hour (11,000 kbps / 8 (bits to bytes) / 1024 (kbps to Mbps) / 1024 (Mbps to Gbps) x 60 (seconds) x 60 (minutes)4.83
GB/hour with redundancy9.66
Total (GB/hour * $0.03)$0.28/hour

Table 8: MediaPackage ingest pricing

AWS ServiceCost per hour [USD]
Total MediaPackage with 1% of egress (180 GB x $0.05)$9.01

Table 9: MediaPackage packaging and origin pricing

Note: We assume that MediaPackage serves 1% of the traffic to CloudFront and viewers, and the rest is served by CloudFront. We use Table 5 below to get the 1% of egress for MediaPackage in Table 4.

Viewer traffic pricing

The cost estimate for viewer traffic assumes that all viewers get the highest bitrate for the one-hour live streaming event.

AWS ServiceFunctionTotal
Amazon CloudFrontAverage Mbps per viewer4.1
Amazon CloudFrontTotal MB per sec (10,000 x 4.1 / 8)5125
Amazon CloudFrontTotal Egress per hour (5125 / 1024 x 60 x 60)18,017 GB/hour
Total cost (10,240 GB * $0.085 + 7,777 GB * 0.08): $1,492.56/hour

Table 10: Viewer traffic pricing

Note: Pricing is per minute, with a minimum of 10 minutes. Prices are subject to change. For full details, refer to the pricing webpage for each AWS service you will be using in this Guidance.

Cost example 3

Cost example 3 covers a use case of approximately 100 viewers viewing live events for about two hundred hours every month with an HD-1080p encoding profile selected in the CloudFormation template. This cost example is based on the following factors:

Pricing Region: us-east-1, assuming standard pricing (no free-tier or discounts)

Viewers consume the highest bitrate: Note that bitrate consumption is a mix of all the streams, but the highest bitrate is used in the calculation to show the upper cost range. Additionally, the QVBR and variable video complexity can result in an output bandwidth that is 10-50% lower in price than the estimate provided in Table 11.

99% cache/hit ratio between the CDN and AWS Elemental MediaPackage

Note: Storage of the test player is not included in this cost estimate.

Table 11 summarizes the total pricing for the live streaming event. Tables 12 through 15 breaks down the cost for each AWS service.

AWS ServiceFunctionCost per 200 hours [USD]
AWS Elemental MediaLiveInput and outputs for channel$750
AWS Elemental MediaPackageIngest of channel$58.01
AWS Elemental MediaPackagePackaging and origination$96.68
Amazon CloudFrontDistribution$2,934.00
Total: $3,838.69

Table 11: Cost breakdown for 100 viewers for 200 hours per month

AWS Elemental MediaLive pricing

Table 7 breaks down the AWS Elemental MediaLive pricing which assumes HD AVC input and both SD and HD AVC outputs with less than 10Mbps bit rate and less than 30fps frame rate.

Input / OutputCost per 200 hours [USD]
HD Input (AVC, 10-20Mpbs)$46.80
Output 1 SD (512x288, 400k)$88.00
Output 2 SD (640x360, 800k)$88.00
Output 3 SD (768x432, 1200k)$88.00
Output 4 SD (960x540, 1800k)$88.00
Output 5 HD (1280x720p, 2700k)$176.00
Output 6 HD (1920x1080p, 4100k)$176.00
Total:$750 for 200 hours

Table 12: MediaLive pricing

MediaPackage ingest pricing

As detailed in Cost Example 1, MediaPackage pricing is based on GB ingested per second across all streams of live output. Table 13 shows the conversion from kbps to Mbps to Gbits/second to GB/hour.

Input/Outputkbps
Output 1 (512x288_400k)400
Output 2 (640x360_800k)800
Output 3 (768x432_1200k)1200
Output 4 (960x540_1800k)1800
Output 5 (1280x720p_2700k)2700
Output 6 (1920x1080p_4100k)4100
Total kbps11,000
Convert kbps to GB/200 hours(11,000 kbps / 10 (kbps to Mbps) / 1024 (Mbps to Gbps) / 8 (Gbps to GB/s) x 60 (seconds) x 60 (minutes) x 200 (hours)966.79
GB/200 hours with redundancy1933.59
Total (GB/hour * $0.03)$58.01

Table 13: MediaPackage ingest pricing

AWS ServiceCost per 200 hours [USD]
Total MediaPackage with 1% of egress (180 GB x $0.05)96.68

Table 14: MediaPackage packaging and origin pricing

Note: We assume that MediaPackage serves 1% of the traffic to CloudFront and viewers, and the rest is served by CloudFront. We use Table 15 below to get the 1% of egress for MediaPackage in Table 14.

Viewer traffic pricing

The cost estimate for viewer traffic assumes that all viewers get the highest bitrate for the one-hour live streaming event.

AWS ServiceFunctionTotal
Amazon CloudFrontAverage Mbps per viewer4.1
Amazon CloudFrontTotal MB per sec (100 x 4.1 / 8)51.25
Amazon CloudFrontTotal Egress per 200 hours (51.25 / 1024 x 60 x 60 x 200)36,035 GB/200 hours
Total cost (10,240 GB * $0.085 + 25,795 GB * 0.08): $2,934.00/200 hours

Table 15: Viewer traffic pricing

Note: Pricing is per minute, with a minimum of 10 minutes. Prices are subject to change. For full details, refer to the pricing webpage for each AWS service you will be using in this Guidance.

Security

When you build systems on AWS infrastructure, security responsibilities are shared between you and AWS. This shared responsibility model reduces your operational burden because AWS operates, manages, and controls the components including the host operating system, virtualization layer, and physical security of the facilities in which the services operate. For more information about security on AWS, visit AWS Cloud Security.

Amazon CloudFront

This Guidance deploys a static website hosted in an Amazon S3 bucket. To help reduce latency and improve security, this Guidance includes an Amazon CloudFront distribution with an origin access identity, which is a special CloudFront user that helps restrict access to the Guidance’s website bucket contents. For more information, refer to Restricting Access to Amazon S3 Content by Using an Origin Access Identity.

Supported AWS Regions

This Guidance uses AWS Elemental MediaLive, MediaPackage, and MediaConnect, which are currently available in specific AWS Regions only. Therefore, you must launch this Guidance in an AWS Region where these services are available. For the most current service availability by Region, refer to AWS service offerings by Region. If you use MediaConnect as input, you must deploy this Guidance in the same Region as your MediaConnect flows.

Quotas

Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account.

Quotas for AWS services in this Guidance

Make sure you have sufficient quota for each of the services implemented in this Guidance. For more information, refer to AWS service quotas.

Click one of the following links to go to the page for that service. To view the service quotas for all AWS services in the documentation without switching pages, view the information in the Service endpoints and quotas page in the PDF instead.

AWS CloudFormation quotas

Your AWS account has CloudFormation quotas that you should be aware of when launching the stack for this Guidance. By understanding these quotas, you can avoid limitation errors that would prevent you from deploying this Guidance successfully. For more information, refer to AWS CloudFormation quotas in the _AWS CloudFormation Users Guide_.

Deploy the Guidance

The default deployment create an AWS Lambda function, an AWS Elemental MediaLive input and channel, an AWS Elemental MediaPackage channel, two Amazon CloudFront distributions, and an Amazon Simple Storage Service (Amazon S3) bucket for the demo HTML preview player, but you can also customize the template based on your specific needs.

Deployment consideration

The Guidance for Live Streaming on AWS configures AWS Elemental MediaLive with one of three progressive, 30 frames-per-second encoding profiles. You can choose one of the following encoding profiles.

  • HD-1080p profile - 1920x1080, 1280x720, 960x540, 768x432, 640x360, 512x288

  • HD-720p profile - 1280x720, 960x540, 768x432, 640x360, 512x288

  • SD-540p profile - 960x540, 768x432, 640x360, 512x288

Important: This Guidance includes an option to send anonymized operational metrics to AWS. We use this data to better understand how customers use this Guidance and related services and products. AWS owns the data gathered though this survey. Data collection is subject to the AWS Privacy Policy.

To opt out of this feature, download the template, modify the AWS CloudFormation mapping section, and then use the AWS CloudFormation console to upload your template and deploy the Guidance. For more information, refer to the Anonymized data collection section of this guide.

Prerequisites:

The are 2 options for deploying the solution: using the CDK deployment tools or running the build script to generate a CFN template and the packaged lambda code.

Option 1: Deploying through the CDK.

This options simply flollows the standard CDK deployment process. You will need to run cdk bootstrap before you run cdk deploy the first time to setup the cdk resource in your AWS account.

  1. Download or clone the repo and make the required changes to the source code.
  2. installl the dependencies for the lambda function and construct.
  3. then run cdk deploy (first time use you will need to run cdk bootstrap first)
cd ./source/custom-resource
npm install --production
cd ../constructs
npm install
cdk bootstrap //if you havent already done so.
cdk deploy

Option 2: Generate a CloudFormation template.

The CloudFormation template (generated by the CDK) includes a lambda backed custom resource to configure MediaLive and create a UUID. To launch the solution the Lambda source code has to be deployed to an Amazon S3 bucket in the region you intend to deploy the solution.

1. Clone the repo

Download or clone the repo and make the required changes to the source code.

2. (Optional) Run unit tests for any customization

Run unit tests to make sure added customization passes the tests:

cd ./deployment
chmod +x ./run-unit-tests.sh && ./run-unit-tests.sh

3. Create an Amazon S3 Bucket

The CloudFormation template is configured to pull the Lambda deployment packages from Amazon S3 bucket in the region the template is being launched in. Create a bucket in the desired region with the region name appended to the name of the bucket. eg: for us-east-1 create a bucket named: my-bucket-us-east-1

aws s3 mb s3://my-bucket-us-east-1

Ensure that you are owner of the AWS S3 bucket.

aws s3api head-bucket --bucket my-bucket-us-east-1 --expected-bucket-owner YOUR-AWS-ACCOUNT-NUMBER

4. Create the deployment packages

Build the distributable:

chmod +x ./build-s3-dist.sh
./build-s3-dist.sh <my-bucket> live-streaming-on-aws <version>

Notes: The build-s3-dist script expects the bucket name as one of its parameters. This value should not have the region suffix (remove the -us-east-1)

Deploy the distributable to the Amazon S3 bucket in your account:

aws s3 sync ./regional-s3-assets/ s3://my-bucket-us-east-1/live-streaming-on-aws/<version>/
aws s3 sync ./global-s3-assets/ s3://my-bucket-us-east-1/live-streaming-on-aws/<version>/

5. Launch the stack

Before you launch the Guidance, review the cost, architecture, security, and other considerations discussed in this guide. Follow the step-by-step instructions in this section to configure and deploy the Guidance into your account.

Time to deploy: Approximately 20 minutes

  1. Sign in to the AWS Management Console

  2. Locate the live-streaming-on-aws.template in your S3 bucket and copy the URL

  3. Navigate to the CloudFormation Console

    Note: This Guidance uses the AWS Elemental MediaLive, MediaPackage, and MediaConnect services, which are currently available in specific AWS Regions only. Therefore, you must launch this Guidance in an AWS Region where these services are available. For the most current service availability by Region, see the AWS Regional Services List.

  4. On the Create stack page, paste the template S3 URL in the Amazon S3 URL text box and choose Next.

  5. On the Specify stack details page, assign a name to your Live Streaming on AWS Guidance stack.

  6. Under Parameters, review the parameters for the template and modify them as necessary.

This Guidance uses the following default values. Refer to URL_PULL (HLS) input configuration, RTMP_PULL input configuration, RTMP_PUSH and RTP_PUSH input configuration, and MEDIACONNECT input configuration for detailed instruction for setting up each input type.

ParameterDefaultDescription
LIVE STREAM SOURCE  
Source Input TypeURL_PULLSpecify the input type for AWS Elemental MediaLive: RTP_PUSH, RTMP_PUSH, RTMP_PULL, URL_PULL, or MEDIACONNECT.
URL_PULL and RTML_PULL CONFIGURATION  
Primary Source URLhttps://d15an60oaeed9r.cloudfront.net/live_stream_v2/sports_reel_with_markers.m3u8The primary source URL for the live feed. By default, this parameter contains the primary demo source URL.
Primary Source Username<Optional input>If authentication is required to access the source, enter the username.
Primary Source Password<Optional input>If authentication is required to access the source, enter the password.
Secondary Source URLhttps://d3h5srgm8b0t83.cloudfront.net/live_stream_v2/sports_reel_with_markers.m3u8The secondary (backup) source URL for the live feed. By default, this parameter contains the secondary demo source URL.
Secondary Source Username<Optional input>If authentication is required to access the secondary source, enter the username.
Secondary Source Password<Optional input>If authentication is required to access the secondary source, enter the password.
RTP_PUSH and RTMP_PUSH CONFIGURATION  
Input CIDR Block<Requires input>Specify the CIDR block for the MediaLive security group for push input types.
MEDIACONNECT CONFIGURATION  
Primary MediaConnect ARN<Optional input>The primary source MediaConnect flow for the live feed. You can create the flow in the MediaConnect console. To provide redundancy, create the primary and secondary flows in different Availability Zones.
Secondary MediaConnect ARN<Optional input>The secondary source MediaConnect flow for the live feed. You can create the flow in the MediaConnect console. To provide redundancy, create the primary and secondary flows in different Availability Zones.
ENCODING OPTIONS  
Encoding Profile720Specify the encoding profile to use with MediaLive.
Start MediaLive ChannelyesChoose whether to start the MediaLive channel when the Guidance is created. We recommend starting the channel if you will use the HTML preview player.
  1. Choose Next

  2. On the Configure stack options page, choose Next.

  3. On the Review page, review and confirm the settings. Check the box acknowledging that the template will create IAM resources.

  4. Choose Create to deploy the stack.

You can view the status of the stack in the AWS CloudFormation Console in the Status column. You should receive a CREATE_COMPLETE status in approximately 20 minutes.

To test the live stream playback, navigate to the AWS CloudFormation stack Outputs tab, select the Demo Console URL from the Value column.

Note: In addition to the primary AWS Lambda function, this Guidance includes the Guidance-helper Lambda function, which runs only during initial configuration or when resources are updated or deleted.

When running this Guidance, both Lambda functions are displayed in the AWS Lambda console, do not delete the Guidance-helper function because it is necessary to manage associated resources.

Once the live streaming event is complete, terminate the resources created by this Guidance to help ensure that you don’t incur unnecessary AWS charges.

Monitoring the Guidance with Service Catalog AppRegistry

The Guidance for Live Streaming on AWS includes a Service Catalog AppRegistry resource to register the CloudFormation template and underlying resources as an application in both AWS Service Catalog AppRegistry and AWS Systems Manager Application Manager.

AWS Systems Manager Application Manager gives you an application-level view into this Guidance and its resources so that you can:

  • Monitor its resources, costs for the deployed resources across stacks and AWS accounts, and logs associated with this Guidance from a central location.

  • View operations data for the resources of this Guidance in the context of an application, such as deployment status, CloudWatch alarms, resource configurations, and operational issues.

The following figure depicts an example of the application view for the Live Streaming on AWS stack in Application Manager.

Application Manager screen

Figure 2: Application Manager Screen

Live Streaming on AWS stack in Application Manager

Note: You must activate CloudWatch Application Insights, AWS Cost Explorer, and cost allocation tags associated with this Guidance. They are not activated by default.

Activate CloudWatch Application Insights

  1. Sign in to the Systems Manager console.

  2. In the navigation pane, choose Application Manager.

  3. In Applications, choose AppRegistry applications.

  4. In AppRegistry applications, search for the application name for this Guidance and select it.

The next time you open Application Manager, you can find the new application for your Guidance in the AppRegistry application category.

  1. In the Components tree, choose the application stack you want to activate.

  2. In the Monitoring tab, in Application Insights, select Auto-configure Application Monitoring.

    Application Insights screen

    Figure 3: Application Insights screen

  3. Monitoring for your applications is now activated and the following status box appears:

    Monitoring enabled screen

    Figure 4: Monitoring enabled message

Activate AWS Cost Explorer

You can see the overview of the costs associated with the application and application components within the Application Manager console through integration with AWS Cost Explorer which must be first activated. Cost Explorer helps you manage costs by providing a view of your AWS resource costs and usage over time. To activate Cost Explorer for the Guidance:

  1. Sign in to the AWS Cost Management console.

  2. In the navigation pane, select Cost Explorer.

  3. On the Welcome to Cost Explorer page, choose Launch Cost Explorer.

The activation process can take up to 24 hours to complete. Once activated, you can open the Cost Explorer user interface to further analyze cost data for the Guidance.

Activate cost allocation tags associated with the Guidance

After you activate Cost Explorer, you must activate the cost allocation tags associated with this Guidance to see the costs for this Guidance. The cost allocation tags can only be activated from the management account for the organization. To activate cost allocation tags:

  1. Sign in to the AWS Billing and Cost Management console.

  2. In the navigation pane, select Cost Allocation Tags.

  3. On the Cost allocation tags page, filter for the AppManagerCFNStackKey tag, then select the tag from the results shown.

  4. Choose Activate.

The activation process can take up to 24 hours to complete and the tag data to appear.

Confirm cost tags associated with the Guidance

After you activate cost allocation tags associated with the Guidance, you must confirm the cost allocation tags to see the costs for this Guidance. To confirm cost allocation tags:

  1. Sign in to the Systems Manager console.

  2. In the navigation pane, choose Application Manager.

  3. In Applications, choose the application name for this Guidance and select it.

  4. In the Overview tab, in Cost, select Add user tag.

    Add user tag scren

    Figure 5: Add user tag screen

  5. On the Add user tag page, enter confirm, then select Add user tag.

The activation process can take up to 24 hours to complete and the tag data to appear.

Uninstall the Guidance

You can uninstall the Guidance for Live Streaming on AWS from the AWS Management Console or by using the AWS Command Line Interface (AWS CLI).

You must manually delete the S3 buckets created by this Guidance. This Guidance does not automatically delete S3 buckets in case you have stored data to retain.

Delete the stack

Using the AWS Management Console

  1. Sign in to the AWS CloudFormation console.

  2. On the Stacks page, select this Guidance’s installation stack.

  3. Choose Delete.

Using AWS Command Line Interface

Determine whether the AWS CLI is available in your environment. For installation instructions, refer to What Is the AWS Command Line Interface  in the AWS CLI User Guide. After confirming that the AWS CLI is available, run the following command.

aws cloudformation delete-stack --stack-name <installation-stack-name>

Delete the Amazon S3 buckets

Using the AWS Management Console

This Guidance is configured to retain the Guidance-created Amazon S3 buckets if you decide to delete the CloudFormation stack to prevent accidental data loss. After uninstalling the Guidance, you can manually delete the S3 buckets if you do not need to retain the data. Follow these steps to delete the Amazon S3 buckets.

  1. Sign in to the Amazon S3 console.

  2. Choose Buckets from the left navigation pane.

  3. Locate the <stack-name> S3 buckets.

  4. Select the S3 bucket and choose Empty to remove all data from the bucket.

  5. Select the S3 bucket and choose Delete to permanently remove the bucket from your account.

Using AWS Command Line Interface

To delete the S3 bucket using AWS CLI, run the following command. You will not need to empty the bucket first when using the --force option.

aws s3 rb s3://<bucket-name> --force

Developer guide

This section provides the source code for the Guidance.

Source code

Visit our GitHub repository to download the templates and scripts for this Guidance, and to share your customizations with others. The Live Streaming on AWS template is generated using the AWS CDK. Refer to the README.md file for additional information.

Supplemental Topics

Reference

This section includes information about an optional feature for collecting unique metrics for this Guidance and a list of builders who contributed to this Guidance.

Anonymized data collection

This Guidance includes an option to send anonymized operational metrics to AWS. We use this data to better understand how customers use this Guidance and related services and products. When invoked, the following information is collected and sent to AWS:

  • Solution ID - The AWS Guidance identifier

  • Unique ID (UUID) - Randomly generated, unique identifier for each Live Streaming on AWS deployment

  • Timestamp - Data-collection timestamp

  • Example: Instance Data: Count of the state and type of instances that are managed by the EC2 Scheduler in each AWS Region

    Example data:

    Running: {t2.micro: 2}, {m3.large:2}
    Stopped: {t2.large:1}, {m3.xlarge:3}
    

AWS owns the data gathered though this survey. Data collection is subject to the AWS Privacy Policy. To opt out of this feature, complete the following steps before launching the AWS CloudFormation template.

  1. Download the AWS CloudFormation template to your local hard drive.

  2. Open the AWS CloudFormation template with a text editor.

  3. Modify the AWS CloudFormation template mapping section from:

    AnonymizedData:
      SendAnonymizedData:
        Data: Yes
    

    to:

    AnonymizedData:
      SendAnonymizedData:
        Data: No
    
  4. Sign in to the AWS CloudFormation console.

  5. Select Create stack.

  6. On the Create stack page, specify template section, select Upload a template file.

  7. Under Upload a template file, choose Choose file and select the edited template from your local drive.

  8. Choose Next and follow the steps in Launch the stack in the Deploy the Guidance section of this guide.

Contributors

  • Tom Nightingale
  • Tom Gilman
  • Joan Morgan
  • Eddie Goynes
  • Kiran Patel
  • Aijun Peng
  • San Dim Ciin
  • Sean Byrne
  • Damian McNamara

Revisions


DateChange.
November 2016Initial release
March 2017Added an AWS CloudFormation parameter for the Elemental Live server version.
April 2017Changed all Elemental references to AWS Elemental to reflect the new name.
September 2018Added information about AWS Elemental MediaLive and MediaPackage functionality, and encoding profiles.
December 2018Added information about the Amazon CloudFront distribution for the static website hosted in the Amazon S3 bucket.
March 2019Added information about MediaConnect input and CMAF format functionality.
December 2019Updated Cost information; updated the Lambda run-times to Node 12.x and Python 3.8.
July 2020Updated encoding settings and appendices with input configuration details. For a detailed description of the changes from version 2.3.0 to version 2.4.0, refer to the CHANGELOG.md file in the GitHub repository.
June 2021Documentation updates only: Expanded the cost estimates to provide more granular information, clarified the collection of operational metrics information, and updated guide organization to improve readability.
August 2021Release version 3.0.0: Updated with new features and bug fixes. For more information, refer to the CHANGELOG.md file in the GitHub repository.
September 2021Documentation update only: Provided additional details about the demo preview player.
November 2021Release version 3.1.0: Bug fixes. For more information, refer to the CHANGELOG.md file in the GitHub repository.
January 2022Release version 3.1.1: Bug fixes. For more information, refer to the CHANGELOG.md file in the GitHub repository.
March 2022Release version 3.1.2: Bug fixes. For more information, refer to the CHANGELOG.md file in the GitHub repository.
July 2022Release version 4.0.0: Solution conversion to AWS CDK. For more information, refer to the CHANGELOG.md file in the GitHub repository.
November 2022Release version 4.1.0: Added AppRegistry support for the Guidance. For more information, refer to the CHANGELOG.mdfile in the GitHub repository.
April 2023Release version 4.2.0: Updated Guidance to use CDK 2 from CDK 1, updated AppRegistry, and security updates. Also, added a couple of new sections in the documentation, such as features and benefits, use cases, concepts and definitions, and the Well-Architected design framework. For more information, refer to the CHANGELOG.md file in the GitHub repository.
April 2023Release version 4.2.1: Mitigated impact caused by new default settings for S3 Object Ownership (ACLs disabled) for all new S3 buckets. For more information, refer to the CHANGELOG.md file in the GitHub repository.
August 2023Release version 4.2.2: Updated npm packages and lambda runtimes to NodeJS 18 and AWS SDKv3. Updated Cost table and added additional cost examples. For more information, refer to the CHANGELOG.md file in the GitHub repository.
October 2023Release version 4.2.3: Updated package versions to resolve security vulnerabilities. For more information, refer to the CHANGELOG.md file in the GitHub repository.
November 2023Documentation update: Added Confirm cost tags associated with the guidance to the Monitoring the guidance with AWS Service Catalog AppRegistry section.
February 2026Documentation update: Format changes to suppport conversion from Solution to Guidance. Update of deployment instructions to match source repo README

Notices

Customers are responsible for making their own independent assessment of the information in this document. This document: (a) is for informational purposes only, (b) represents AWS current product offerings and practices, which are subject to change without notice, and (c) does not create any commitments or assurances from AWS and its affiliates, suppliers or licensors. AWS products or services are provided “as is” without warranties, representations, or conditions of any kind, whether express or implied. AWS responsibilities and liabilities to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.

Live Streaming on AWS is licensed under the terms of the of the Apache License Version 2.0 available at The Apache Software Foundation.