

# What is AWS Elemental MediaPackage?
<a name="what-is"></a>

AWS Elemental MediaPackage (MediaPackage) is a just-in-time video packaging and origination service that runs in the AWS Cloud. With MediaPackage, you can deliver highly secure, scalable, and reliable video streams to a wide variety of playback devices and content delivery networks (CDNs). 

MediaPackage offers a broadcast-grade viewing experience for viewers, while allowing you the flexibility to control and protect your content. Additionally, the built-in resiliency and scalability of MediaPackage means that you have the right amount of resources at the right time, with no manual intervention required.

**Topics**
+ [Are you a first-time user of MediaPackage?](first-time-user.md)
+ [Concepts and terminology](what-is-terms.md)
+ [Supported inputs and outputs](supported-inputs.md)
+ [How MediaPackage works](what-is-flow.md)
+ [Features of AWS Elemental MediaPackage](what-is-features.md)
+ [Related services](related-services.md)
+ [Accessing MediaPackage](accessing-emp.md)
+ [Pricing for MediaPackage](pricing-for-emp.md)
+ [Regions for MediaPackage](regions-and-endpoints.md)

# Are you a first-time user of MediaPackage?
<a name="first-time-user"></a>

If you're a first-time user of MediaPackage, we recommend that you begin by reading the following sections:
+ [Concepts and terminology](what-is-terms.md)
+ [How MediaPackage works](what-is-flow.md)
+ [Features of AWS Elemental MediaPackage](what-is-features.md)
+ [Getting started with AWS Elemental MediaPackage](getting-started.md)

# Concepts and terminology
<a name="what-is-terms"></a>

AWS Elemental MediaPackage (MediaPackage) includes the following components:

**Just-in-time packaging**  
MediaPackage performs *just-in-time packaging* (JITP). When a playback device requests content, MediaPackage dynamically customizes the live video streams and creates a manifest in a format that's compatible with the requesting device.

**Origination service**  
MediaPackage is considered an *origination service* because it's the point of distribution for media content delivery.

**Packager**  
A *packager* prepares output streams for access by different types of players. The packager type specifies the streaming format that MediaPackage delivers from the endpoint (either Apple HLS, DASH-ISO, Microsoft Smooth Streaming, or Common Media Application Format [CMAF]). Additional packager settings include buffer and update durations and manifest tag handling instructions.   
A packager is a part of an endpoint. Each endpoint must have one, and only one, packager. To use different packager types for the same content, create multiple endpoints on the channel.

**Source Content**  
*Source contents* are live streams and video files that MediaPackage ingests.   
+ For live video, source content comes from an upstream encoder, such as AWS Elemental MediaLive. MediaPackage supports HLS source content.
+ For video on demand (VOD), source content resides in an Amazon Simple Storage Service (Amazon S3) bucket in your AWS account. MediaPackage supports HLS and MP4 (.smil manifest format) content.

**Stream**  
A *stream* refers to the content input and output of MediaPackage.   
For live workflows, an upstream encoder sends a live stream as an input to MediaPackage to the channel. When a downstream device requests playback of the content, MediaPackage dynamically packages the stream (including specifying the packager type, adding encryption, and configuring track outputs) and delivers it to the requesting device as an output of the endpoint. An endpoint can produce multiple streams.  
For VOD workflows, MediaPackage pulls file-based content from Amazon S3. As with live workflows, when a downstream device requests playback of the content, MediaPackage dynamically packages the stream and delivers it to the requesting device as an output of the asset resource.

**Track**  
*Tracks* make up the output content stream. MediaPackage includes selected video, audio, and subtitles or captions tracks in the output stream. The stream delivers the tracks to the player (either directly or through a CDN), and the player plays back the tracks based on player logic or network conditions (such as available bandwidth).

## Live components
<a name="what-is-terms-live"></a>

The following components apply to live workflows in MediaPackage:

**Channel**  
A *channel* represents the entry point for a content stream into MediaPackage. Upstream encoders such as AWS Elemental MediaLive send content to the channel. When MediaPackage receives a content stream, it packages the content and outputs the stream from an endpoint that you create on the channel. There's one channel for each incoming set of adaptive bitrate (ABR) streams.

**Endpoint**  
An *endpoint* is part of a channel and represents the packaging aspect of MediaPackage. When you create an endpoint on a channel, you indicate what streaming format, packaging parameters, and features the output stream will use. Downstream devices request content from the endpoint. A channel can have multiple endpoints.

**Harvest Job**  
A *harvest job* is a task that you create to extract a VOD asset from a live content stream. A harvest job defines the start and end times of the VOD asset, and where MediaPackage stores the asset. When the job runs, MediaPackage creates an HLS clip for the times that you indicated. This clip is stored as a VOD asset in an Amazon S3 bucket of your choosing. You can use the VOD functionality in MediaPackage to serve the asset to end users.

## VOD Components
<a name="what-is-terms-vod"></a>

The following components apply to VOD workflows in MediaPackage:

**Asset**  
An *asset* represents the entry point for file-based content into MediaPackage. MediaPackage uses the information in the asset to locate and ingest your source content from Amazon S3. When you create an asset in MediaPackage, you associate it with a *packaging group*, which holds one or more *packaging configurations*. Each asset and packaging configuration combination provides a URL for playback of repackaged content. Each asset is associated with all the packaging configurations within one packaging group.

**Packaging Configuration**  
A *packaging configuration* defines how MediaPackage formats, encrypts, and delivers source content to viewers. The packaging configuration includes settings such as stream selection, encryption, segment duration and combining, and one or more HLS, DASH, MSS, or CMAF manifest definitions.

**Packaging Group**  
A *packaging group* is a set of one or more packaging configurations. Because you can associate the group to more than one asset, the group provides an efficient way to associate multiple packaging configurations with multiple assets. 

# Supported inputs and outputs
<a name="supported-inputs"></a>

This section describes the input types, input codecs, and output codecs that AWS Elemental MediaPackage supports for live and video on demand (VOD) content.

**Topics**
+ [Live supported codecs and input types](supported-inputs-live.md)
+ [Live-to-VOD supported codecs and input types](supported-inputs-ltov.md)
+ [VOD supported codecs and input types](supported-inputs-vod.md)

# Live supported codecs and input types
<a name="supported-inputs-live"></a>

The following sections describe supported input types, input codecs, and output codecs for live streaming content.

## Supported input types
<a name="supported-types-live"></a>

These are the input types that MediaPackage supports for live content.


| MediaPackage input type | Use case | 
| --- | --- | 
| HLS | Push an HLS stream from an external source or encoder (such as AWS Elemental MediaLive) using the HTTPS protocol.Additional requirements:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html) | 

## Supported input codecs
<a name="suported-inputs-codecs-live"></a>

These are the video, audio, and subtitles codecs that MediaPackage supports for source content streams.


| Media container | Video codecs | Audio codecs | Subtitles/captions format | 
| --- | --- | --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html) | 

## Supported output codecs
<a name="suported-outputs-codecs-live"></a>

These are the video, audio, and subtitles codecs that MediaPackage supports when delivering live content.


| Endpoint type | Manifest format | Media container | Video codecs | Audio codecs | Subtitles/captions format | 
| --- | --- | --- | --- | --- | --- | 
| Apple HLS | HLS |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  | 
| DASH-ISO | MPEG-DASH | MP4 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  | 
| Microsoft Smooth | MSS | MP4 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  | DFXP | 
| CMAF | HLS | CMAF |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-live.html)  | 

# Live-to-VOD supported codecs and input types
<a name="supported-inputs-ltov"></a>

The following sections describe supported input types, input codecs, and output codecs for live-to-VOD assets that are harvested from streaming content in AWS Elemental MediaPackage.

## Supported input types
<a name="supported-types-ltov"></a>

These are the input types that MediaPackage supports for live-to-VOD assets.


| MediaPackage input type | Use case | 
| --- | --- | 
| HLS | Extract a portion of a live HLS or DASH endpoint in MediaPackage and save it as a live-to-VOD asset. Additional requirements:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html) | 

## Supported input codecs
<a name="supported-inputs-codecs-ltov"></a>

These are the video, audio, and subtitles codecs that MediaPackage supports for live-to-VOD assets.


| Media container | Video codecs | Audio codecs | Subtitles/captions format | 
| --- | --- | --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  | 

## Supported output codecs
<a name="supported-outputs-codecs-ltov"></a>

These are the video, audio, and subtitles codecs that MediaPackage supports when saving a live-to-VOD asset to an Amazon S3 bucket. The endpoint must serve either clear (unencrypted) or encrypted DASH or HLS content.


| Endpoint type | Manifest format | Media container | Video codecs | Audio codecs | Subtitles/captions format | 
| --- | --- | --- | --- | --- | --- | 
| Apple HLS | HLS |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  | 
| DASH-ISO | MPEG-DASH | MP4 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-ltov.html)  | 

# VOD supported codecs and input types
<a name="supported-inputs-vod"></a>

The following sections describe supported input types, input codecs, and output codecs for file-based video on demand (VOD) content.

## Supported input types
<a name="supported-types-vod"></a>

These are the input types that MediaPackage supports for VOD content.


| MediaPackage input type | Use case | 
| --- | --- | 
| HLS | Pull an HLS stream set from an Amazon S3 bucket, with or without a secure connection.Additional requirements:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html) | 
| SMIL | Pull an MP4 stream set referenced by a .smil manifest from an Amazon S3 bucket, with or without a secure connection. For information about the .smil manifest, see [Requirements for .smil manifests](supported-inputs-vod-smil.md).Additional requirements:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html) | 

## Supported input codecs
<a name="suported-inputs-codecs-vod"></a>

These are the video, audio, and subtitles codecs that MediaPackage supports for file-based source content.


| Input type | Media container | Video codecs | Audio codecs | Subtitles/captions format | 
| --- | --- | --- | --- | --- | 
| HLS |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  | 
| SMIL | MP4 (non-fragmented) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  | SRT | 

## Supported output codecs
<a name="suported-outputs-codecs-vod"></a>

These are the video, audio, and subtitles codecs that MediaPackage supports for delivering VOD content.


| Endpoint type | Manifest format | Media container | Video codecs | Audio codecs | Subtitles/captions format | 
| --- | --- | --- | --- | --- | --- | 
| Apple HLS | HLS |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  | 
| DASH-ISO | MPEG-DASH | MP4 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  | 
| Microsoft Smooth | MSS | MP4 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  | DFXP | 
| CMAF | HLS | CMAF |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediapackage/latest/ug/supported-inputs-vod.html)  | 

# Requirements for .smil manifests
<a name="supported-inputs-vod-smil"></a>

When sending a VOD MP4 asset to AWS Elemental MediaPackage, a .smil manifest must be included. The .smil manifest is an XML file that acts as a wrapper for all the files in the asset, letting MediaPackage know which MP4s are part of a single asset.

**Resources**
+ For guidance on creating a .smil manifest, see [.smil using AWS Elemental MediaPackage VOD](https://aws.amazon.com/blogs/media/smil-using-aws-elemental-mediapackage-vod/) (blog).
+ For general information about Synchronized Multimedia Integration Language (SMIL), see the [SMIL 3.0 specification](https://www.w3.org/TR/SMIL/).

MediaPackage supports the following attributes in a .smil manifest.

**Attributes**
+ `audioName` - The name of the audio track, such as `English 2`.
+ `includeAudio` - A Boolean value indicating if the audio tracks should be included. This attribute should contain as many values as there are languages defined. If not specified, all tracks default to `true`.
+ `src` or `name` - Either the name or the source of the text stream or video file relative to the manifest location.
+ `subtitleName` - The subtitle name, such as `English`.
+ `systemLanguage` or `language` - The system language, such as `eng`.

**Example .smil manifest**  
The following is an example of a `.smil` manifest.   

```
<?xml version="1.0" encoding="utf-8"?>
<smil>
    <body>
        <alias value="Example"/>
        <switch>
            <video name="example_360.mp4" systemLanguage="eng,fra,spa" audioName="English,French,Spanish" includeAudio="true,true,true"/>
            <video name="example_480.mp4" systemLanguage="eng" audioName="English 2" includeAudio="false"/>
            <textstream src="example_subs_eng.srt" systemLanguage="eng" subtitleName="English" includeAudio="false"/>
            <textstream src="example_subs_fra.srt" systemLanguage="fra" subtitleName="French" includeAudio="false"/>
            <textstream src="example_subs_spa.srt" systemLanguage="spa" subtitleName="Spanish" includeAudio="false"/>
    </switch>
</body>
</smil>
```

# How MediaPackage works
<a name="what-is-flow"></a>

AWS Elemental MediaPackage (MediaPackage) uses just-in-time format conversion to deliver over-the-top (OTT) video from a single source to a wide variety of playback devices or content delivery networks (CDNs).

The following sections describe how MediaPackage works.

**Topics**
+ [Live content processing](what-is-flow-live.md)
+ [VOD Content Processing](what-is-flow-vod.md)
+ [Live and VOD manifest reference](what-is-manifest.md)

# Live content processing
<a name="what-is-flow-live"></a>

In the processing flow for live content, encoders send live HLS streams to MediaPackage. MediaPackage then packages the content, formatting it in response to playback requests from downstream devices. 

The following sections describe the live processing flows.

**Topics**
+ [General MediaPackage live processing flow](what-is-flow-gen.md)
+ [Live input redundancy AWS Elemental MediaPackage processing flow](what-is-flow-ir.md)

# General MediaPackage live processing flow
<a name="what-is-flow-gen"></a>

The following outlines the general flow of live content in MediaPackage:

1. An upstream encoder (such as AWS Elemental MediaLive) sends an HLS live stream with digest authentication over WebDAV to the MediaPackage channel input URL, and includes the channel's access credentials (as supplied in MediaPackage). If you're using input redundancy, the encoder sends two identical HLS live streams to MediaPackage, one to each input URL on the channel. MediaPackage uses the stream from one input URL as the source content. If MediaPackage stops receiving content on the active input URL, it automatically switches to the other input URL for source content. Additionally, AWS scales resources up and down to handle the incoming traffic.

   For more information, see [Live input redundancy AWS Elemental MediaPackage processing flow](what-is-flow-ir.md).
**Note**  
To allow support for features like time-shifted viewing, MediaPackage stores all received content for a limited time. This stored content is only available for playback if it falls within the **startover window** that's defined on the endpoint. Stored content isn't available for playback if it's outside the startover window, or if you haven't defined a window on the endpoint. For more information, see [Time-shifted viewing reference in AWS Elemental MediaPackage](time-shifted.md).

1. A downstream device requests content from MediaPackage through the endpoint output URL. A downstream device is either a video player or a CDN. The output URL is associated with an endpoint for a specific streaming format (either Apple HLS, DASH-ISO, Microsoft Smooth Streaming, or CMAF).

1. When MediaPackage receives the playback request from the downstream device, it dynamically packages the stream according to the settings that you specified on the endpoint. Packaging can include adding encryption and configuring audio, video, and subtitles or captions track outputs.

   Be sure to order your inputs so that your preferred audio rendition is listed first in the audio section of the parent manifest. Do the same for the subtitles or captions. When packaging audio and subtitles or captions tracks, MediaPackage designates the first audio and captions or subtitles track as `DEFAULT=YES` and `AUTO-SELECT=YES`. This packaging overrides default and auto-select settings from the input.

1. MediaPackage delivers the output stream over HTTPS to the requesting device. As with input, AWS scales resources up and down to handle changes in traffic.

1. MediaPackage logs activity through Amazon CloudWatch. You can view information such as the number of content requests and amount of content that MediaPackage has received or delivered. For information about viewing MediaPackage metrics in CloudWatch, see [Monitoring AWS Elemental MediaPackage with Amazon CloudWatch metrics](monitoring-cloudwatch.md).

Throughout the content input and output processes, MediaPackage detects and mitigates potential infrastructure failures before they become a problem for viewers. 

The following illustration shows the overall process.

![\[MediaPackage workflow\]](http://docs.aws.amazon.com/mediapackage/latest/ug/images/bbl_flow1.png)


# Live input redundancy AWS Elemental MediaPackage processing flow
<a name="what-is-flow-ir"></a>

Achieve input redundancy in AWS Elemental MediaPackage by sending two streams to separate input URLs on a channel in MediaPackage. One of the streams becomes the primary, active source of content for the endpoints, while the other continues to passively receive content. If MediaPackage stops receiving content from the active stream, it switches over to the other input stream so that content playback isn't interrupted.

If you use MediaPackage with AWS Elemental MediaLive (for example), here's the flow of input redundancy:

1. You create a channel in MediaPackage, as described in [Creating a channel](channels-create.md). When MediaPackage provisions the channel, it creates two input URLs for the channel. If you're not using input redundancy, you can send a stream to either input URL. There's no requirement that you send content to both URLs.
**Note**  
When input redundancy became available, MediaPackage added a second input URL to existing channels and updated the existing URL to a new format. You can use either the existing URL or the new URLs for content input. 

1. You create an endpoint in MediaPackage as described in [Creating an endpoint](endpoints-create.md). 
**Important**  
If you use short output segments, depending on your playback device, you might see buffering when MediaPackage switches inputs. You can reduce buffering by using the time delay feature on the endpoint. Be aware that using a time delay introduces latency to end-to-end delivery of the content. For information about enabling time delay, see [Creating an endpoint](endpoints-create.md).

1. You create an input and channel in AWS Elemental MediaLive, and you add a MediaPackage output group to the channel in MediaLive. For more information, see [Creating a Channel from Scratch](https://docs.aws.amazon.com/medialive/latest/ug/creating-channel-scratch.html) in the *AWS Elemental MediaLive User Guide*. 

   If you use an HLS output group in AWS Elemental MediaLive, the input loss action on the HLS group's settings must be set to pause the output if the service doesn't receive input. If MediaLive sends a black frame or some other filler frame when it's missing input, then MediaPackage can't tell when segments are missing, and subsequently can't perform failover. For more information about setting the input loss action in MediaLive, see [Fields for the HLS Group](https://docs.aws.amazon.com/medialive/latest/ug/hls-group-fields.html) in the *AWS Elemental MediaLive User Guide*. 
**Important**  
If you use a different encoder (not AWS Elemental MediaLive) and you send two separate streams to the same channel in MediaPackage, the streams must have identical encoder settings and manifest names. Otherwise, input redundancy might not work correctly and playback could be interrupted if the inputs switch.

1. You start the channel in AWS Elemental MediaLive to send the streams to MediaPackage.

1. MediaPackage receives content on both of the input URLs, but only one of the streams is used for source content at a time. If the active stream is missing any segments, then MediaPackage automatically fails over to the other stream. MediaPackage continues to use this stream until failover is needed again.

   The formula that's used to determine if an input is missing segments is based on the segment lengths on the inputs and the endpoints. If an input is missing segments and quickly recovers, an endpoint with longer segment lengths won't switch inputs. This might result in different endpoints on the channel using different inputs (if one endpoint switches and the other doesn't). This is expected behavior and should not affect the content workflow.

# VOD Content Processing
<a name="what-is-flow-vod"></a>

In the processing flow for VOD content, AWS Elemental MediaPackage ingests file-based video content from Amazon S3. MediaPackage then packages the content, formatting it in response to playback requests from downstream devices. 

Here is the general processing flow for VOD content in MediaPackage:

1.  From the MediaPackage asset, you initiate ingest of the source content from an Amazon S3 bucket. This process can take several minutes. You receive an Amazon CloudWatch event when ingest is complete and the playback URLs are live.

1. A downstream device requests content from MediaPackage through the packaging configuration URL on the asset. A downstream device is either a video player or a CDN. The URL is associated with a configuration for a specific streaming format (either Apple HLS, DASH-ISO, Microsoft Smooth Streaming, or CMAF).

1. When MediaPackage receives the playback request from the downstream device, it dynamically packages the stream according to the settings that you specified in the packaging configuration. Packaging can include adding encryption and configuring audio, video, and subtitles or captions track outputs.

   Be sure to order your inputs so that your preferred audio rendition is listed first in the audio section of the parent manifest. Do the same for the subtitles or captions. When packaging audio and subtitles or captions tracks, MediaPackage designates the first audio and captions or subtitles track as `DEFAULT=YES` and `AUTO-SELECT=YES`. This packaging overrides default and auto-select settings from the input.

1. MediaPackage delivers the output stream over HTTPS to the requesting device. As with input, AWS scales resources up and down to handle changes in traffic.

1. MediaPackage logs activity through Amazon CloudWatch. You can view information like the number of content requests and amount of content that MediaPackage has delivered. For information about viewing MediaPackage VOD metrics in CloudWatch, see [Monitoring AWS Elemental MediaPackage with Amazon CloudWatch metrics](monitoring-cloudwatch.md).

Throughout the content input and output processes, MediaPackage detects and mitigates potential infrastructure failures before they become a problem for viewers. 

# Live and VOD manifest reference
<a name="what-is-manifest"></a>

AWS Elemental MediaPackage delivers live and video on demand (VOD) manifests to requesting devices. A live manifest indicates that the content isn't complete. New content continually becomes available through the playback endpoint. Alternatively, a VOD manifest indicates that the program is complete, or will be complete at a specified time in the future. 

This section describes the differences in live and VOD manifests, and explains when MediaPackage delivers each manifest type.

# Manifest properties
<a name="manifest-properties"></a>

These are the main properties in a manifest that determine if it's live or VOD:
+ For HLS and CMAF VOD manifests, `EXT-X-ENDLIST` is at the end of the bitrate manifests. In live manifests, this tag isn't present.
+ For MPEG-DASH VOD manifests, `type="static"` is in the `MPD` properties. In live manifests, `type=dynamic`.
+ For Microsoft Smooth VOD manifests, `IsLive` isn't present in the `SmoothStreamingMedia` properties. In live manifests, `IsLive=TRUE`.

For VOD, the scrub bar on playback devices also often shows that the program has a limited duration. This duration is equal to the length of the current manifest. If a playback request defines a specific playback window, this duration is equal to the length of that playback window. 

To determine if the manifest is live or VOD, see [Live and VOD manifest reference](what-is-manifest.md).

## When a manifest is VOD
<a name="manifest-complete"></a>

MediaPackage delivers a VOD manifest when the content of the program is complete. MediaPackage considers a program complete under the following conditions:

**There's an `end` parameter in the past.**  
When a playback request includes an `end` parameter that's set in the past, the content is complete. No new content is added to it. MediaPackage delivers a static, VOD manifest to downstream devices.  
For information about start and end parameters in playback requests, see [Time-shifted viewing reference in AWS Elemental MediaPackage](time-shifted.md).

**The manifest that the upstream encoder delivers to MediaPackage includes an `EXT-X-ENDLIST` tag.**  
When you stop the output from your encoder, the manifest that it sends to MediaPackage includes an `EXT-X-ENDLIST` tag. This tag tells MediaPackage that the content is complete, and no new content will be added. MediaPackage delivers a static, VOD manifest to downstream devices.  
If you manually stop an AWS Elemental MediaLive channel when one or both pipelines to MediaPackage are stopped, MediaLive doesn't include `EXT-X-ENDLIST` in the HLS manifest to MediaPackage. MediaPackage continues to produce a live manifest.   
If both pipelines are active when you stop the channel, MediaLive includes `EXT-X-ENDLIST`. MediaPackage delivers a VOD manifest to downstream devices.
If you restart the output from the encoder, the manifest from MediaPackage becomes live again. Playback devices might need to refresh to resume content playback.  
If you're using input redundancy and the active stream ends, MediaPackage fails over to the other incoming stream for input. The manifest isn't marked as complete unless both incoming streams end.

# Features of AWS Elemental MediaPackage
<a name="what-is-features"></a>

MediaPackage supports the following features:

**Accessibility support**  
MediaPackage supports audio and subtitles accessibility signaling for HLS, CMAF, and DASH VOD assets that are created from an HLS source.   
+ Audio accessibility signaling supports functionality like Descriptive Voice Services (DVS) to help make media accessible to people who are blind or visually impaired. For example, an audio track might be used to provide an audio description of the scene.
+ Subtitles accessibility signaling helps make media accessible to people who are deaf or hard of hearing. For example, a subtitles track might be used to provide description of music and sound effects in the video. 
To enable players to provide accessibility signaling, MediaPackage passes through the `EXT-X-MEDIA` tag and attributes from the source playlist.  
 The `EXT-X-MEDIA` tag must include a `CHARACTERISTICS` attribute with an appropriate value for accessibility signalling to work.  
+ For audio accessibility, the value must be `public.accessibility.describes-video`.
+ For subtitles accessibility, the value must include one or both of `public.accessibility.describes-music-and-sound` and `public.accessibility.transcribes-spoken-dialog`.

**Example EXT-X-MEDIA tag with accessibility caption attribute**  
 `#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="captions-group",NAME="accessibility-captions1",LANGUAGE="eng", CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound",AUTOSELECT=YES,DEFAULT=YES,URI="caption-accessibility-eng.m3u8"` 

**Allow listing**  
Allow listing is available with only live workflows in MediaPackage.  
MediaPackage supports restricting network access to the endpoint. To take advantage of this feature, you must enter the allowed IP addresses on the endpoint. For more information about adding allow listing information, see [Access control settings fields](endpoints-hls-access-control.md).

**Audio**  
MediaPackage supports multi-language audio inputs and the following audio codecs:  
+ AAC stereo
+ Dolby AC3 and E-AC3 (Dolby Digital and Dolby Digital\$1)
MediaPackage accepts these codecs from the input source and passes them through to the output stream.  
Be sure to order your inputs so that your preferred audio rendition is listed first in the audio section of the parent manifest. When packaging audio and subtitles or captions tracks, MediaPackage designates the first audio track as `DEFAULT=YES` and `AUTO-SELECT=YES`. This packaging overrides default and auto-select settings from the input.  
MediaPackage doesn't support audio-only inputs. The stream configuration from the encoder must include at least one video track.

**Captions**  
Your embedded source captions can be CEA-608 captions, CEA-708 captions, or both CEA-608 and CEA-708. MediaPackage will pass through these captions in the media segments and parent manifest on HLS, CMAF, and DASH endpoints, and generate the appropriate manifest signaling.  
Be sure to order your inputs so that your preferred captions rendition is listed first in the captions section of the parent manifest. When packaging captions tracks, MediaPackage designates the first captions track as `DEFAULT=YES` and `AUTO-SELECT=YES`. This packaging overrides default and auto-select settings from the input.  
Your input HLS playlist must include captions signaling tags. If not present, MediaPackage will not be able to generate the corresponding output manifest signaling.

**CDN Authorization**  
MediaPackage supports content delivery network (CDN) authorization. For information, see [CDN authorization in AWS Elemental MediaPackage](cdn-auth.md).

**DRM**  
MediaPackage supports content protection through digital rights management (DRM). For information, see [Content encryption and DRM in AWS Elemental MediaPackage](using-encryption.md).

**HLS Rendition Groups**  
MediaPackage supports rendition groups for incoming and outgoing HLS content. For information about output rendition groups, see [Rendition groups reference in AWS Elemental MediaPackage](rendition-groups.md).

**Live to VOD**  
Use the harvest job resource to extract a live-to-VOD (video on demand) asset from a live content stream. MediaPackage creates the asset and stores it in an Amazon S3 bucket. You can use the VOD functionality in MediaPackage to deliver the asset to end users.

**Input Redundancy**  
Input redundancy is available with only live workflows in MediaPackage.  
MediaPackage creates two input URLs on every channel so that you can create input redundancy by sending two identical streams to the same channel. For information about how input redundancy works, see [Live input redundancy AWS Elemental MediaPackage processing flow](what-is-flow-ir.md).

**Subtitles**  
MediaPackage supports input WebVTT text-based subtitles. MediaPackage translates the subtitles to the appropriate format based on the packager that's used on the endpoint:  
+ For HLS and CMAF: WebVTT is passed through
+ For DASH: subtitles are translated to EBU-TT
+ For Microsoft Smooth Streaming: subtitles are translated to DFXP
Be sure to order your inputs so that your preferred subtitles rendition is listed first in the subtitles section of the parent manifest. When packaging subtitles tracks, MediaPackage designates the first subtitles track as `DEFAULT=YES` and `AUTO-SELECT=YES`. This packaging overrides default and auto-select settings from the input.

**Time-shift Viewing**  
Time-shift viewing is available with only live workflows in MediaPackage.  
MediaPackage allows playback of a stream at a time earlier than the current time. Start-over, catch-up TV, and time delay are all supported. For more information about setting up time-shift capabilities, see [Time-shifted viewing reference in AWS Elemental MediaPackage](time-shifted.md).

**Video**  
MediaPackage supports the input H.264 video codec and passes it through to the output stream. CMAF endpoints in MediaPackage also support H.265/HEVC and HDR-10, following the Apple specification to applicable playback devices.  
MediaPackage requires at least one video track to be present in the stream configuration from the encoder. The service doesn't support audio-only ingest.

# Related services
<a name="related-services"></a>
+ **Amazon CloudFront** is a global content delivery network (CDN) service that securely delivers data and videos to your viewers. Use CloudFront to deliver content with the best possible performance. For more information, see [Amazon CloudFront](https://aws.amazon.com/cloudfront/).
+ **Amazon CloudWatch** is a monitoring service for AWS Cloud resources and the applications that you run on AWS. Use CloudWatch to track metrics such as content input and output request counts. For more information, see [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/).
+ **AWS Elemental MediaLive (MediaLive)** is a live video processing service that encodes high-quality live video streams for broadcast television and multi-screen devices. Use MediaLive to encode content streams and send them to MediaPackage for packaging. For more information about how encoders (such as MediaLive) work with MediaPackage, see [How MediaPackage works](what-is-flow.md).
+ **AWS Identity and Access Management (IAM)** is a web service that helps you securely control access to AWS resources for your users. Use IAM to control who can use your AWS resources (authentication) and what resources users can use in which ways (authorization). For more information, see [Setting up MediaPackage](setting-up.md).
+ **AWS Elemental MediaTailor (MediaTailor)** is a scalable ad insertion service that runs in the AWS Cloud. Use MediaTailor to serve targeted ads to viewers. For more information, see [AWS Elemental MediaTailor](https://aws.amazon.com/mediatailor/).
+ **Amazon Simple Storage Service (Amazon S3)** is a storage service. Pull video on demand (VOD) assets from Amazon S3, or store live-to-VOD assets in the bucket of your choice. For more information, see [Getting started with VOD content delivery in MediaPackage](getting-started-vod.md) and [Getting started with live-to-VOD content delivery in MediaPackage](getting-started-ltov.md).

# Accessing MediaPackage
<a name="accessing-emp"></a>

You can access MediaPackage using any of the following methods.
+ **AWS Management Console** - The procedures throughout this guide explain how to use the AWS Management Console to perform tasks for MediaPackage.

  ```
  https://console.aws.amazon.com/mediapackage/
  ```
+ **AWS Command Line Interface** - For more information, see the [AWS Command Line Interface User Guide](https://docs.aws.amazon.com/cli/latest/userguide/). 

  ```
  aws mediapackage
  ```
+ **MediaPackage API** - For information about API actions and about how to make API requests, see the [AWS Elemental MediaConnect API Reference](https://docs.aws.amazon.com/mediaconnect/latest/api/). 

  ```
  https://mediapackage.region.amazonaws.com 
  ```
+ **AWS SDKs** - If you're using a programming language that AWS provides an SDK for, you can use an SDK to access MediaPackage. SDKs simplify authentication, integrate easily with your development environment, and provide easy access to MediaPackage commands. For more information, see [Tools for Amazon Web Services](https://aws.amazon.com/tools).
+ **AWS Tools for Windows PowerShell** - For more information, see the [AWS Tools for PowerShell User Guide](https://docs.aws.amazon.com/powershell/latest/userguide/).

# Pricing for MediaPackage
<a name="pricing-for-emp"></a>

As with other AWS products, there are no contracts or minimum commitments for using MediaPackage. You are charged only for AWS resources that your account uses. Pricing is pay-as-you-go and consists of the following:
+ A per GB charge for received content
+ A per GB charge for content that's streamed out of MediaPackage

  Content that's cached and served from a content delivery network (CDN) doesn't incur this per GB charge.

For detailed pricing information, see [MediaPackage Pricing](https://aws.amazon.com/mediapackage/pricing/).

# Regions for MediaPackage
<a name="regions-and-endpoints"></a>

To reduce latency in your applications, MediaPackage offers a regional endpoint for your requests. To view the list of AWS Regions where MediaPackage is available, see [MediaPackage Regions](https://docs.aws.amazon.com/general/latest/gr/mediapackage.html).

MediaPackage control plane APIs support IPv6 in all supported regions. For more information, see [IPv6 support for AWS Elemental MediaPackage control plane](mediapackage-ipv6-support.md).

## AWS opt-in Regions
<a name="opt-in-region-considerations"></a>

Although most AWS Regions are active by default for your AWS account, certain Regions are activated only when you manually select them. This document refers to those Regions as *opt-in Regions*. In contrast, Regions that are active by default, as soon as your AWS account is created, are referred to as *commercial Regions*, or simply, *Regions*.

The term *opt-in* has a historical basis. Any AWS Regions introduced after March 20, 2019 are considered to be opt-in Regions. Opt-in Regions have higher security requirements than commercial Regions, regarding the sharing of IAM data through accounts that are active in opt-in Regions. All of the data managed through the IAM service is considered identity data, including users, groups, roles, policies, identity providers, their associated data (for example, X.509 signing certificates or context-specific credentials), and other account-level settings, such as password policy and the account alias.

You can activate opt-in Regions automatically during channel setup, by selecting them. Your channel becomes active in all selected Regions.

If you choose to select an opt-in Region as for your MediaPackage resources, enable it first by following the steps in [Enabling a Region](https://docs.aws.amazon.com//general/latest/gr/rande-manage.html#rande-manage-enable), when signed in to the AWS Management Console. 

MediaPackage is available in the following AWS opt-in Regions:
+ Middle East (UAE) Region, me-central-1
+ Asia Pacific (Hyderabad) Region, ap-south-2
+ Asia Pacific (Melbourne) Region, ap-southeast-4