

# Setup: Creating output groups and outputs
<a name="medialive-outputs"></a>

This section describes how to plan and create output groups and outputs in an AWS Elemental MediaLive. 

You create output groups and outputs when you [create or edit a channel](creating-channel-scratch.md). When you create a channel, you must create at least one output group. After you have created the channel, you can edit it to add more output groups. 

On the console, you create output groups on the **Outputs** section of the **Channel** page. You can't create the output groups and outputs separately from the channel that they belong to.

**Topics**
+ [Creating an Archive output group](opg-archive.md)
+ [Creating a CMAF Ingest output group](opg-cmafi.md)
+ [Creating a Frame capture output group](opg-framecapture.md)
+ [Creating an HLS output group](opg-hls.md)
+ [Creating a MediaConnect Router output group](opg-mediaconnect-router.md)
+ [Creating a MediaPackage output group](opg-mediapackage.md)
+ [Creating a Microsoft Smooth output group](opg-mss.md)
+ [Creating an RTMP output group](opg-rtmp.md)
+ [Creating an SRT output group](opg-srt.md)
+ [Creating a UDP output group](opg-udp.md)

# Creating an Archive output group
<a name="opg-archive"></a>

When you create a AWS Elemental MediaLive channel, you might want to include an Archive output group. For information about the use cases for an Archive output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

**Topics**
+ [Organize encodes in an Archive output group](design-archive-package.md)
+ [Coordinate with the downstream system](archive-op-origin-server-s3.md)
+ [Create an Archive output group](creating-archive-output-group.md)

# Organize encodes in an Archive output group
<a name="design-archive-package"></a>

An Archive output group can contain the following:
+ One or more outputs.

The output contains the following:
+ One video encode. 
+ Zero or more audio encodes.
+ Zero or more captions encodes. The captions are either embedded or object-style captions.

Typically, the Archive output group mirrors the output structure of another output group. For example, it might mirror the ABR stack in an HLS output group.

This diagram illustrates an Archive output group that contains one output that holds one video encode with embedded captions, and two audio encodes. 

![\[Output group diagram showing one output with a video encode and two audio encodes.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output3-nonABR-Ve-2A.png)


This diagram illustrates an Archive output group that contains one output that holds one video encode, two audio encodes, and two object-style captions encode.

![\[Output group containing V, A, A, C, C elements representing video, audio, and caption encodes.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output4-nonABR-V-2A-2C.png)


# Coordinate with the downstream system
<a name="archive-op-origin-server-s3"></a>

The destination for an Archive output group is always in an Amazon S3 bucket. You and the Amazon S3 operator must agree about the bucket to use.

**To arrange setup of the destination**

1. Decide if you need two destinations for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

1. We recommend that you design the full path of the destination — the Amazon S3 bucket and all the folders. See [Fields for the output destination](archive-destinations.md).

1.  Ask the Amazon S3 user to create any buckets that don't already exist. 

   With MediaLive, the Amazon S3 bucket name must not use dot notation, which means it mustn't use . (dot) between the words in the bucket name. 

1. Discuss bucket ownership with the Amazon S3 user. If the bucket belongs to another AWS account, you typically want that account to become the owner of the output. For more information, see [Controlling access to the output](#setting-dss-archive-canned-acl), after this procedure.

Note that you don't need user credentials to send to an S3 bucket. MediaLive has permission to write to the bucket via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

## Controlling access to the output
<a name="setting-dss-archive-canned-acl"></a>

You might be sending output files to an Amazon S3 bucket that is owned by another AWS account. In this situation, you typically want the other account to become the owner of the output files (the object being put in the bucket). If the bucket owner doesn't become the object owner, you (MediaLive) will be the only agent that can delete the files when the files are no longer required.

It is therefore in everyone's interest to transfer ownership of the output files after they are in the Amazon S3 bucket.

To transfer object ownership, the following setup is required:
+ The bucket owner must add a bucket permissions policy that grants you permission to add an Amazon S3 canned access control list (ACL) when MediaLive delivers the output files to the bucket. The bucket owner should read the information in [Managing access with ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acls) in the Amazon Simple Storage Service user guide. The bucket owner must set up ACL permissions for the bucket, not for the objects. 
+ The bucket owner should also set up object ownership. This feature effectively makes it mandatory (rather than optional) for the sender (MediaLive) to include the *Bucket owner full control* ACL. The bucket owner should read the information in [Controlling object ownership](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership) in the Amazon Simple Storage Service user guide.

  If the bucket owner implements this feature, then you must set up MediaLive to include the ACL. If you don't, delivery to the Amazon S3 bucket will fail.
+ You must set up MediaLive to include the *Bucket owner full control** *ACL when it delivers to the bucket. You will perform this setup when you [create the channel](archive-destinations.md).

The S3 canned ACL feature supports ACLs other than *Bucket owner full control*. But those other ACLs are typically not applicable to the use case of delivering video from MediaLive.

# Create an Archive output group
<a name="creating-archive-output-group"></a>

You create the output group and its outputs when you [create or edit a MediaLive channel](creating-a-channel-step4.md). 

1. On the **Create channel** page, under **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **Archive**, and then choose **Confirm**. More sections appear:
   + **Archive group destination** – This section contains fields for the [output destination](archive-destinations.md). 
   + **Archive settings** – This section contains fields for the [output destination](archive-destinations.md). 
   + **Archive outputs** – This section shows the output that is added by default. An Archive output can contain only one output, so don't click **Add output**

1. In **Archive outputs**, choose the **Settings** link to view the sections for the individual output:
   + **Output settings** – This section contains fields for the [output destination](archive-destinations.md) and the [output container](archive-container.md).
   + **Stream settings** – This section contains fields for the [output streams](archive-streams.md) (the video, audio, and captions).

1. (Optional) Enter names for the output group and the output:
   + In **Archive settings**, for **Name**, enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Game 10122017 ABR** or **tvchannel59**.
   + In **Archive outputs**, for **Name**, enter a name for the output. This name is internal to MediaLive; it doesn't appear in the output.

1. To complete the other fields, see the topics listed after this procedure.

**Topics**
+ [Fields for the output destination](archive-destinations.md)
+ [Fields for the output container](archive-container.md)
+ [Fields for the video, audio, and captions streams (encodes)](archive-streams.md)

# Fields for the output destination
<a name="archive-destinations"></a>

The following fields configure the location and names of the Archive output files (the destination).
+ **Output group** – **Archive group destination** section
+ **Output group** – **Archive settings** – **CDN settings**
+ **Output group** – **Additional settings** – **Rollover interval**
+ **Archive outputs** – **Name modifier**
+ **Archive outputs** – **Extension**

You must design the destination path or paths for the output. You must then enter the different portions of the path into the appropriate fields on the console. 

# Design the path for the output destination
<a name="archive-about-destination-path"></a>

1. Design the destination path or paths, following this syntax:

   `protocol bucket folders baseFilename nameModifier counter extension`

   For example, for a standard channel:

   `s3ssl://amzn-s3-demo-bucket/channel59/delivery/curling-20171012T033162.000000.m2ts`

   `s3ssl://amzn-s3-demo-bucket1/channel59/delivery/curling-20171012T033162.000000.m2ts`

If you have two destinations, the destination paths must be different from each other in some way. At least one of the portions of one path must be different from the other. It is acceptable for all the portions to be different.

The following table maps each portion in the example to the portion in the syntax.


| Portion of the URL | Example | Comment | 
| --- | --- | --- | 
| protocol | s3ssl:// | The protocol is always s3ssl:// because the destination for an Archive output is always an S3 bucket. | 
| bucket portion of the path | amzn-s3-demo-bucket |  With MediaLive, the Amazon S3 bucket name must not use dot notation. For example, **mycompany-videos** is acceptable but **mycompany.videos** isn't.   | 
| folders portion of the path | channel59/delivery/ | The folders can be present or not, and can be as long as you want.The folders must always end with a slash. | 
| baseFilename | curling | Don't terminate the file name with a slash. | 
| nameModifier | -20171012T033162 | The modifier is optional for an Archive output. | 
| delimiter before the counter | . | MediaLive automatically inserts this delimiter. | 
| counter | 000000 | MediaLive automatically generates this counter. Initially, this is a six-digit number starting at 000000, and increasing by 1. So 000000, 000001, 000002 and so on. After 999999, the next number is 1000000 (seven digits), then 1000001, 1000002, and so on. Then from 9999999 to 10000000 (eight digits), and so on. | 
| dot before the extension | . | MediaLive automatically inserts this dot. | 
| extension | m2ts | Always m2ts. | 

# Complete the fields on the console
<a name="archive-specify-destination"></a>

1. Enter the different portions of the destination in the appropriate fields.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/archive-specify-destination.html)

1. Leave the **Credentials** section blank in both the **Archive group destinations** sections. MediaLive has permission to write to the S3 bucket via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

1. Complete the **CDN settings** field only if MediaLive must set a canned ACL whenever it sends this output to the Amazon S3 bucket.

   Use of a canned ACL typically only applies if your organization is not the owner of the Amazon S3 bucket. You should have discussed the use of a canned ACL with the bucket owner when you discussed the [destination for the output](archive-op-origin-server-s3.md#setting-dss-archive-canned-acl).

1. Complete the **Rollover interval** field in the **Archive settings** section.

   For example, **300** divides the output into separate files, each with a 300 second (5 minutes) long duration. 

   Each time the rollover expires, MediaLive closes the current file on Amazon S3 and starts a new file using the `baseFilename`, the `nameModifier`, and a sequential counter. 

   The current file is visible on Amazon S3 only after it has closed.

For more information, see the [examples](archive-examples.md). 

# Examples of destination fields for an Archive output group
<a name="archive-examples"></a>

These examples show how to set up the fields that relate to file locations. They don't show how to set up other fields such as fields in the individual outputs.

## Example 1
<a name="archive-example-1"></a>

You want to create an archive of the streaming output from TV channel 59. You want to store the output in the S3 bucket named **amzn-s3-demo-bucket**, and you want to break up the stream into 5-minute chunks.


| Field | Value | 
| --- | --- | 
| Rollover interval field in Archive settings section | 300 | 
| URL in Archive group destination A section | s3ssl://amzn-s3-demo-bucket/channel59/delivery/curling | 
| URL in Archive group destination B section | s3ssl://amzn-s3-demo-bucket/channel59/backup/curlingUsing *delivery* and *backup* as folder names is only an example. | 
| Name modifier in Archive outputs section | -\$1dt\$1For information about identifiers for variable data (such as `$dt$`), see [Identifiers for variable data in MediaLive](variable-data-identifiers.md). | 
| Extension in Archive outputs section | Leave blank to use the default (.m2ts). | 

Result: the output will be broken into files of 5 minutes (300 seconds) each. Each file will have a file name of **curling**, the time that the channel started and a counter (000000, 000001, and so on), and the file name extension. For example:
+ The first file will be **curling-20171012T033162-000001.m2ts**.
+ The second file will be **curling-20171012T033162-000002.m2ts**.

Each file will be stored in both **s3ssl://amzn-s3-demo-bucket/channel59/delivery** and **s3ssl://amzn-s3-demo-bucket/channel59/backup**. 

A given file is not visible in Amazon S3 while it is being written. As soon as the rollover happens (or if the user stops the channel), MediaLive closes the current file. At that point, the file becomes visible.

## Example 2
<a name="archive-example-3"></a>

You want to create an archive of highlights from the curling game that are also being streamed (in a separate HLS output group). You want to create three outputs: one that has audio languages for Europe, one for audio languages for Asia, and one for audio languages for Africa. You want to store the outputs in the S3 buckets named **amzn-s3-demo-bucket1** and **amzn-s3-demo-bucket2**. You want to break up the stream into 5 minute chunks. 


| Field | Value | 
| --- | --- | 
| Rollover interval field in Archive settings section | 300 | 
| URL in Archive group destination A section | s3ssl://amzn-s3-demo-bucket1/sports-delivery/highlights/curling/10312017In this example, the **10312017** folder is set to match today's date. | 
| URL in Archive group destination B section | s3ssl://amzn-s3-demo-bucket2/sports-delivery/highlights/curling/10312017In this example, the paths have different bucket names. | 
| Name modifier in Archive outputs section |  Choose **Add output** twice: two more **Output** lines are added to this section, for a total of three lines. In each line, enter a modifier: **-audiogroup1**, **-audiogroup2**, and **-audiogroup3**.  | 
| Extension in Archive outputs section | Leave blank to use the default (.m2ts). | 

Result: three separate categories of files are created for each output. Each file has a file name of **10312017**, plus the modifier, the sequential counter, and the file name extension. For example:
+ `10312017-audiogroup1-000000.m2ts`, `10312017-audiogroup2-000000.m2ts`, and `10312017-audiogroup3-000000.m2ts`. 
+ `10312017-audiogroup1-000001.m2ts`, `10312017-audiogroup2-000001.m2ts`, and `10312017-audiogroup3-000001.m2ts`. 

Each file will be stored in both `s3ssl://amzn-s3-demo-bucket1/sports-delivery/highlights/curling` and `s3ssl://amzn-s3-demo-bucket2/sports-delivery/highlights/curling`.

A given file is not visible in Amazon S3 while it is being written. As soon as the rollover happens (or if the user stops the channel), MediaLive closes the current file. At that point, the file becomes visible.

# Fields for the output container
<a name="archive-container"></a>

The following fields relate to the packaging and delivery of the archive transport stream:
+ In **Output settings** – **Container Settings** section
+ In **Output settings** – **PID settings** section

For all these fields, optionally change any values. For details about a field, choose the **Info** link next to the field in the MediaLive console.

# Fields for the video, audio, and captions streams (encodes)
<a name="archive-streams"></a>

The following fields relate to the encoding of the video, audio, and captions streams (encodes) in the output. 
+ **Stream settings** section

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

# Creating a CMAF Ingest output group
<a name="opg-cmafi"></a>

When you create a AWS Elemental MediaLive channel, you might want to include a CMAF Ingest output group. For information about the use cases for a CMAF Ingest output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

Note that MediaLive generates a quality score for outputs in a CMAF Ingest output group. For more information, see [Working with MQCS](mqcs.md).

**Topics**
+ [Organize encodes into outputs](design-cmafi-package.md)
+ [Obtain destination](downstream-system-cmafi-empv2.md)
+ [Create output group](creating-cmafi-output-group.md)

# Organize encodes in a CMAF Ingest output group
<a name="design-cmafi-package"></a>

A CMAF Ingest output group typically set up as a video ABR stack. A video ABR stack is an output group that contains the following:
+ More than one outputs.

Each output can contain the following:
+ One video encode (rendition). Typically, each video encode is a different resolution. 
+ Zero or more audio encodes. 
+ Zero or more captions encodes. The captions are embedded captions or sidecar captions.

This diagram illustrates a CMAF Ingest output group when the captions are embedded in the video. Each video encode is in a separate output. The captions are in each video output. Each audio encode is in a separate output.

![\[Output group diagram showing four outputs: two labeled "V embedded" and two labeled "A".\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output13-ABR-2Ve-2Asep.png)


This diagram illustrates a CMAF Ingest output group when the captions are sidecar captions. Each encode is in its own output.

![\[Output group diagram showing six outputs: two V, two A, and two C, representing video, audio, and captions.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output14-ABR-2V-2Asep-2C.png)


# Obtain destination for a CMAF Ingest output group
<a name="downstream-system-cmafi-empv2"></a>

1. Decide if you need two destination URLs for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

1. Obtain the one or two URLs from the MediaPackage operator. The MediaPackage terminology for the URL is *input endpoint*. Make sure that you obtain the URLs (which start with `https://`), not the channel name (which starts with `arn`). 

   Note that you don't use user credentials to send to CMAF Ingest to MediaPackage.

**Example**

Two URLs look like this example:

`https://mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/curling-channel-group/1/curling-channel/`

`https://mz82o4-2.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/curling-channel-group/1/curling-channel/`

Note the following:
+ The `v1/` near the end of the URL is the version of the MediaPackage destination URL schema, it doesn't refer to MediaPackage v1.
+ `curling-channel-group/` is the name of the channel group that the MediaPackage operator created.
+ `curling-channel/` is the name of the MediaPackage channel that the MediaPackage operator created. It isn't the name of the MediaLive channel.
+ The only difference in the two URLs is the `-1` and `-2` before `.ingest`.

# Create a CMAF Ingest output group
<a name="creating-cmafi-output-group"></a>

You create the output group and its outputs when you [create or edit a MediaLive channel](creating-a-channel-step4.md). 

1. On the **Create channel** or **Edit channel** page, in **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **CMAF Ingest**, and then choose **Confirm**. More sections appear:
   + **CMAF Ingest destination** – This section contains fields for the destination of the outputs. You should have obtained the URLs to enter when you [planned the destinations for the CMAF Ingest output group](downstream-system-cmafi-empv2.md). The URL looks like this:

     `https://mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/curling-channel-group/1/curling-channel/`

     Leave the **Credentials** section empty. You don't need to enter credentials to authenticate with MediaPackage.
   + **CMAF Ingest settings** – This section contains fields for configuring how segments are delivered and for configuring how various features behave. See later in this section.
   + **CMAF Ingest outputs** – This section shows the single output that is added by default. You can add more outputs, and you can add video, audio, and captions encodes in each output. See later in this section.

**Topics**
+ [Fields in CMAF Ingest settings section](#cmafi-opg-settings)
+ [Fields for the video, audio, and captions streams (encodes)](#cmafi-opg-streams-section)

## Fields in CMAF Ingest settings section
<a name="cmafi-opg-settings"></a>


| Field | Description | 
| --- | --- | 
| Name | A name for the output group. This name is internal to MediaLive. It doesn't appear in the output. For example, Sports Curling. | 
| SCTE35 Type | To pass through SCTE 35 messages in the output group, choose SCTE\$135\$1WITHOUT\$1SEGMENTATION.The WITHOUT\$1SEGMENTATION wording indicates that each inserted SCTE 35 message will result in a new IDR in the video, but it won't result in a new segment. This handling is standard for CMAF Ingest For more information about setting up for SCTE 35, see [Processing SCTE 35 messages](scte-35-message-processing.md). | 
| Segment Length, Segment Length Units |  Enter the preferred duration of segments (in milliseconds or seconds). The segments will end on the next keyframe after the specified duration, so the actual segment duration might be longer. If the units are seconds, the duration might be a fraction of the seconds.  | 
| Send Delay Msec |  Number of milliseconds to delay the output from pipeline 1, when the channel starts or unpauses. (This field applies only to standard channels. The value is ignored in a single-pipeline channel.)  Some packagers always ingest the first pipeline that they receive. You can therefore set a value here to ensure that pipeline 0 always arrives at the packager first.  | 
| Nielsen ID3 Behavior | For information about this feature, see [Converting Nielsen watermarks to ID3](feature-nielsen-id3.md). | 

## Fields for the video, audio, and captions streams (encodes)
<a name="cmafi-opg-streams-section"></a>

1. In **CMAF Ingest outputs**, choose **Add output** to add the appropriate number of outputs to the list of outputs.

1. Choose the first **Settings** link to view the first output. Each output has two sections: **Output settings** and **Stream settings**.

1. Complete **Output settings**:
   + **Output name**: Change the randomly generated name to a meaningful name. This name is internal to MediaLive; it doesn't appear in the output. 
   + **Name modifier**: MediaLive assigns a sequential modifier to each output in the output group: **\$11**, **\$12**, and so on. Change the name if you want. 

1. Complete **Stream settings**. This section contains fields for the output encodes (the video, audio, and captions) to create in the output. For information about creating encodes, see the following sections:
   + [Set up the video encode](creating-a-channel-step6.md)
   + [Set up the audio encodes](creating-a-channel-step7.md)
   +  [Set up the captions encodes](creating-a-channel-step8.md)

# Creating a Frame capture output group
<a name="opg-framecapture"></a>

When you create a AWS Elemental MediaLive channel, you might want to include a Frame capture output group. A Frame capture output is a supplement to streaming; it isn't itself a streaming output. This type of output might be useful for your workflow. For example, you might use a Frame capture output to create thumbnails of the content. (You can also create thumbnails by using the [thumbnails feature](thumbnails.md).)

**Topics**
+ [Organize encodes in a Frame capture output group](design-framecapture-package.md)
+ [Coordinate with the downstream system](framecapture-op-origin-server-s3.md)
+ [Create a Frame capture output group](creating-framecapture-output-group.md)

# Organize encodes in a Frame capture output group
<a name="design-framecapture-package"></a>

A Frame capture output group can contain the following:
+ One or more outputs.

Each output can contain only one video JPEG encode. 

# Coordinate with the downstream system
<a name="framecapture-op-origin-server-s3"></a>

The destination for a Frame capture output group is always in an Amazon S3 bucket. You and the Amazon S3 operator must agree about the bucket to use.

**To arrange setup of the destination**

1. Decide if you need two destinations for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

   Note that a Frame capture output group requires only one set of destination addresses, not one for each output.

1. We recommend that you design the full path of the destination — the Amazon S3 bucket and all the folders. See or [Frame capture destination](framecapture-destinations.md). 

1. Ask the Amazon S3 user to create any buckets that don't already exist. 

   With MediaLive, the Amazon S3 bucket name must not use dot notation, which means it mustn't use . (dot) between the words in the bucket name. 

1. Discuss bucket ownership with the Amazon S3 user. If the bucket belongs to another AWS account, you typically want that account to become the owner of the output. For more information, see [Controlling access to the output](archive-op-origin-server-s3.md#setting-dss-archive-canned-acl), after this procedure.

Note that you don't need user credentials to send to an S3 bucket. MediaLive has permission to write to the bucket via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

## Controlling access to the output
<a name="setting-dss-framecapture-canned-acl"></a>

You might be sending output files to an Amazon S3 bucket that is owned by another AWS account. In this situation, you typically want the other account to become the owner of the output files (the object being put in the bucket). If the bucket owner doesn't become the object owner, you (MediaLive) will be the only agent that can delete the files when the files are no longer required.

It is therefore in everyone's interest to transfer ownership of the output files after they are in the Amazon S3 bucket.

To transfer object ownership, the following setup is required:
+ The bucket owner must add a bucket permissions policy that grants you permission to add an Amazon S3 canned access control list (ACL) when MediaLive delivers the output files to the bucket. The bucket owner should read the information in [Managing access with ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acls) in the Amazon Simple Storage Service user guide. The bucket owner must set up ACL permissions for the bucket, not for the objects. 
+ The bucket owner should also set up object ownership. This feature effectively makes it mandatory (rather than optional) for the sender (MediaLive) to include the *Bucket owner full control* ACL. The bucket owner should read the information in [Controlling object ownership](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership) in the Amazon Simple Storage Service user guide.

  If the bucket owner implements this feature, then you must set up MediaLive to include the ACL. If you don't, delivery to the Amazon S3 bucket will fail.
+ You must set up MediaLive to include the *Bucket owner full control** *ACL when it delivers to the bucket. You will perform this setup when you [create the channel](archive-destinations.md).

The S3 canned ACL feature supports ACLs other than *Bucket owner full control*. But those other ACLs are typically not applicable to the use case of delivering video from MediaLive.

# Create a Frame capture output group
<a name="creating-framecapture-output-group"></a>

You create the output group and its outputs when you [create or edit a MediaLive channel](creating-a-channel-step4.md). 

1.  On the **Create channel** page, under **Output groups**, choose **Add**. 

1.  In the **Add output group** section, choose **Frame capture**, and then choose **Confirm**. More sections appear. 
   +  **Destination** – This section contains fields for the [output destination](framecapture-destinations.md). 
   +  **Frame capture settings** – This section contains a field for the output group name and for the [output destination](framecapture-destinations.md). 
   +  **Frame capture outputs** – This section shows the output that is added by default. A Frame capture output can contain only one output, so don't click **Add output**.

     To view the fields, choose the **Settings** link. 

1.  In **Frame capture outputs**, choose the **Settings** link to view the sections for the individual output:
   +  **Output settings** – This section contains fields for the [output destination](framecapture-destinations.md). 
   +  **Stream settings** – This section contains fields for the [output streams](output-settings-framecapture.md) (the video, audio, and captions). 

1. (Optional) Enter names for the output group and the output:
   +  In **Frame capture settings**, for **Name**, enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Game Thumbnails**. 
   +  In **Frame capture outputs**, for **Name**, enter a name for the output. This name is internal to MediaLive; it doesn't appear in the output. 

1.  To complete the other fields, see the topics listed after this procedure. 

1.  After you have finished setting up this output group and its single output, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md). 

**Topics**
+ [Frame capture destination](framecapture-destinations.md)
+ [Settings for the stream](output-settings-framecapture.md)

# Frame capture destination
<a name="framecapture-destinations"></a>

The following fields configure the location and names of the frame capture files (the destination).
+ **Output group** – **Frame capture group destination** section
+ **Output group** – **Frame capture settings** – **CDN settings**

  **Output settings** – **Name modifier**

You must design the destination path or paths for the output. You must then enter the different portions of the path into the appropriate fields on the console.

## Design the path for the output destination
<a name="framecapture-about-destination-path"></a>

**To design the path**
+ Design the destination path or paths, following this syntax:

  `protocol bucket folders baseFilename nameModifier counter extension`

  For example, for a standard channel:

  `s3ssl://amzn-s3-demo-bucket1/sports-thumbnails/delivery/curling-20180820.00000.jpg`

  `s3ssl://amzn-s3-demo-bucket1/sports-thumbnails/backup/curling-20180820.00000.jpg`

If you have two destinations, the destination paths must be different from each other in some way. At least one of the portions of one path must be different from the other. It is acceptable for all the portions to be different.

The following table maps each portion in the example to the portion in the syntax.


| Portion of the URL | Example | Comment | 
| --- | --- | --- | 
| protocol | s3ssl:// | The protocol is always s3ssl:// because the destination for a Frame capture output is always an S3 bucket. | 
| bucket portion of the path | amzn-s3-demo-bucket1 |  With MediaLive, the S3 bucket name must not use dot notation, which means it mustn't use . (dot) between the words in the bucket name.   | 
| folders portion of the path | sports-thumbnails/delivery/ | The folders can be present or not, and can be as long as you want.The folders must always end with a slash. | 
| baseFilename | curling | Don't terminate the file name with a slash. | 
| nameModifier | -20180820 | The modifier is optional for an Frame capture output. | 
| delimiter before the counter | . | MediaLive automatically inserts this delimiter. | 
| counter | 00000 | MediaLive automatically generates this counter. Initially, this is a five-digit number starting at 00000, and increasing by 1. So 00000, 00001, 00002 and so on. After 99999, the next number is 100000 (six digits), then 100001, 100002, and so on. Then from 999999 to 1000000 (seven digits), and so on. | 
| dot before the extension | . | MediaLive automatically inserts this dot. | 
| extension | jpg | Always jpg. | 

## Complete the fields on the console
<a name="framecapture-specify-destination"></a>

**To specify the location for the output**

1. Enter the different portions of the destination in the appropriate fields.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/framecapture-destinations.html)

1. Leave the **Credentials** section blank in both the **Frame capture group destinations** sections. MediaLive has permission to write to the S3 bucket via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

1. Complete the **CDN settings** field only if MediaLive must set a canned ACL whenever it sends this output to the Amazon S3 bucket.

   Use of a canned ACL typically only applies if your organization is not the owner of the Amazon S3 bucket. You should have discussed the use of a canned ACL with the bucket owner when you discussed the [destination for the output](archive-op-origin-server-s3.md#setting-dss-archive-canned-acl).

# Settings for the stream
<a name="output-settings-framecapture"></a>

By default, the output is set up with one video encode. This is the only encode that a Frame capture output can contain. Therefore, you can't add audio or captions encodes or more video encodes.

For information about the fields in the video encode, see [Set up the video encode](creating-a-channel-step6.md).

# Creating an HLS output group
<a name="opg-hls"></a>

When you create a AWS Elemental MediaLive channel, you might want to include an HLS output group. For information about the use cases for an HLS output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md). For information about choosing between an HLS and MediaPackage output group, see [Choosing between the HLS output group and MediaPackage output group](hls-choosing-hls-vs-emp.md).

**Topics**
+ [Organize encodes in an HLS output group](design-hls-package.md)
+ [Coordinate with the downstream system](hls-opg-coordinate-dss.md)
+ [Create an HLS output group](creating-hls-output-group.md)

# Organize encodes in an HLS output group
<a name="design-hls-package"></a>

An HLS output group is typically set up as a video ABR stack. A video ABR stack is an output group that contains the following:
+ More than one outputs.

Each output can contain the following:
+ One video encode (rendition). Typically, each video encode is a different resolution.
+ One or more audio encodes.
+ One or more captions encodes. The captions are either embedded or sidecar.

There are two ways to organize the encodes, depending on whether the audio encodes must be bundled or each in their own rendition. You should have already [obtained this information](identify-dss-video-audio.md) from your downstream system.

**Downstream players that require bundled audio**

Plan for the output group to contain the following:
+ One output for each video encode. This output holds one video encode, all the audio encodes, and all the captions encodes (if the captions are embedded). 

  The same audio encodes will appear in each output. For example, the English and French encodes will appear in the high-resolution output, then the same English and French encodes will appear in the low-resolution output.
+ One output for each captions encode, if the captions are sidecars.

This diagram illustrates an HLS output group when the captions encodes are embedded.

![\[Output group diagram showing embedded and non-embedded outputs with associated elements.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output11-ABR-2Ve-2A.png)


This diagram illustrates an HLS output group when the captions encodes are sidecars.

![\[Output group diagram showing V, A, A components, V, A, A outputs, and two C outputs.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output12-ABR-2V-2A-2C.png)


**Downstream players that require separate audio**

Plan for the output group to contain the following:
+ One output for each video encode. This output holds one video and all the captions encodes (if the captions are embedded). 
+ One output for each audio encode.

  The audio encodes might be for different languages, or they might be for different bitrates, or they might be for different languages and bitrates.
+ One output for each captions encode, if the captions are sidecars.

The arrangement of the audio encodes in this output group is called an *audio rendition group*.

This diagram illustrates an HLS output group with an audio rendition group, and with embedded captions encodes.

![\[Output group diagram showing four outputs: two marked as embedded, and two marked as A.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output13-ABR-2Ve-2Asep.png)


This diagram illustrates an HLS output group for an ABR stack with an audio rendition group, and with sidecar captions encodes.

![\[Output group diagram showing six outputs: two V, two A, and two C, arranged in a row.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output14-ABR-2V-2Asep-2C.png)


# Coordinate with the downstream system
<a name="hls-opg-coordinate-dss"></a>

The HLS output group in AWS Elemental MediaLive supports several types of downstream systems. Read the information that applies to the system you are working with.

**Topics**
+ [HLS output group to Amazon S3](origin-server-hls-s3.md)
+ [HLS output group to MediaStore](origin-server-ems.md)
+ [HLS output group to MediaPackage](origin-server-hls-emp.md)
+ [HLS output group to MediaPackage v2](origin-server-hls-empv2.md)
+ [HLS output group to HTTP](origin-server-http.md)

# HLS output group to Amazon S3
<a name="origin-server-hls-s3"></a>

Follow this procedure if you [determined](identify-downstream-system.md) that you will create an HLS output group with Amazon S3 as the destination. You and the operator of the downstream system must agree about the destination for the output of the HLS output group. 

**To arrange setup of the destination**

1. Decide if you need two destinations for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

1. We recommend that you design the full path of the destination — the Amazon S3 bucket and all the folders. See [Design the path for the output destination](hls-destinations-design-step.md).

1. Ask the Amazon S3 user to create any buckets that don't already exist. 

   With MediaLive, the Amazon S3 bucket name must not use dot notation, which means it mustn't use . (dot) between the words in the bucket name. 

1. Discuss ownership with the Amazon S3 user. If the bucket belongs to another AWS account, you typically want that account to become the owner of the output. For more information, see [Controlling access to the output](#setting-dss-hls-canned-acl), after this procedure.

Note that you don't need user credentials to send to an S3 bucket. MediaLive has permission to write to the S3 bucket via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

## Controlling access to the output
<a name="setting-dss-hls-canned-acl"></a>

You might be sending output files to an Amazon S3 bucket that is owned by another AWS account. In this situation, you typically want the other account to become the owner of the output files (the object being put in the bucket). If the bucket owner doesn't become the object owner, you (MediaLive) will be the only agent that can delete the files when the files are no longer required.

It is therefore in everyone's interest to transfer ownership of the output files after they are in the Amazon S3 bucket.

To transfer object ownership, the following setup is required:
+ The bucket owner must add a bucket permissions policy that grants you permission to add an Amazon S3 canned access control list (ACL) when MediaLive delivers the output files to the bucket. The bucket owner should read the information in [Managing access with ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acls) in the Amazon Simple Storage Service user guide. The bucket owner must set up ACL permissions for the bucket, not for the objects.
+ The bucket owner should also set up object ownership. This feature effectively makes it mandatory (rather than optional) for the sender (MediaLive) to include the *Bucket owner full control* ACL. The bucket owner should read the information in [Controlling object ownership](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership) in the Amazon Simple Storage Service user guide.

  If the bucket owner implements this feature, then you must set up MediaLive to include the ACL. If you don't, delivery to the Amazon S3 bucket will fail.
+ You must set up MediaLive to include the *Bucket owner full control** *ACL when it delivers to the bucket. You will perform this setup when you [create the channel](hls-destinations-s3-specify.md).

The S3 canned ACL feature supports ACLs other than *Bucket owner full control*, but those other ACLs are typicallly not applicable to the use case of delivering video from MediaLive.

# HLS output group to MediaStore
<a name="origin-server-ems"></a>

Follow this procedure if you [determined](identify-downstream-system.md) that you will create an HLS output group, with AWS Elemental MediaStore as the destination. You and the operator of the downstream system must agree about the destination for the output of the HLS output group

**To arrange setup of the destination**

1. Decide if you need two destinations for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

1. We recommend that you design the full path of the destination. See [Design the path for the output destination](hls-destinations-design-step.md).

   If you have two destinations, the destination paths must be different from each other in some way. At least one of the portions of one path must be different from the other. It is acceptable for all the portions to be different. 

1. Ask the MediaStore user to create any containers that don't already exist. 

1. Obtain the data endpoint for the container or containers. For example: 

   `https://a23f.data.mediastore.us-west-2.amazonaws.com`

   `https://fe30.data.mediastore.us-west-2.amazonaws.com`

   You need the data endpoints. You don't need the container name.

Note that you don't need user credentials to send to MediaStore containers. MediaLive has permission to write to the MediaStore container via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

# HLS output group to MediaPackage
<a name="origin-server-hls-emp"></a>

Follow this procedure if you [determined](identify-downstream-system.md) that you will create an HLS output group, and will send to AWS Elemental MediaPackage over HTTPS. You and the operator of the downstream system must agree about the destination for the output of the HLS output group.

**To arrange setup of the destination**

1. Ask the MediaPackage user to create one channel on MediaPackage. Even if the MediaLive channel is a [standard channel](plan-redundancy.md) (with two pipelines), you need only one MediaPackage channel.

1. Arrange with the MediaPackage user to set up HTTPS user credentials. You must send to MediaPackage over a secure connection.

1. Obtain the following information:
   + The two URLs (input endpoints is the MediaPackage terminology) for the channel. The two URLs for a channel look like this:

      `https://6d2c.mediapackage.uswest-2.amazonaws.com/in/v2/9dj8/9dj8/channel`

      `https://6d2c.mediapackage.uswest-2.amazonaws.com/in/v2/9dj8/e333/channel`

     The two URLs are always identical, except for the folder just before `channel`.

     Make sure that you obtain the URLs (which start with `https://`), not the channel name (which starts with `arn`).
   + The user name and password to access the downstream system, if the downstream system requires authenticated requests. Note that these user credentials relate to user authentication, not to the protocol. User authentication is about whether the downstream system will accept your request. The protocol is about whether the request is sent over a secure connection.

# HLS output group to MediaPackage v2
<a name="origin-server-hls-empv2"></a>

Follow this procedure if you [determined](hls-choosing-hls-vs-emp.md) that you will create an HLS output group, and will send to MediaPackage v2. You and the operator of the downstream system must agree about the destination for the output of the HLS output group. 

**To arrange setup of the destination**

1. Ask the MediaPackage user to create one channel on MediaPackage. Even if the MediaLive channel is a [standard channel](plan-redundancy.md) (with two pipelines), you need only one MediaPackage channel.

1. Obtain the two URLs (input endpoints is the MediaPackage terminology) for the channel. The two URLs for a channel look like this:

    `https://mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/1/curling/index` 

    `https://mz82o4-2.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/2/curling/index`

   The two URLs are slightly different, as shown in the examples above.

   Make sure that you obtain the URLs (which start with `https://`), not the channel name (which starts with `arn`).

   Note that you don't use user credentials in order to send to MediaPackage v2.

# HLS output group to HTTP
<a name="origin-server-http"></a>

Follow this procedure if you [determined](identify-downstream-system.md) that you will create an HLS output group with one of the following downstream systems as the destination:
+ An HTTP or HTTPS PUT server.
+ An HTTP or HTTPS WebDAV server.
+ An Akamai origin server.

You and the operator of the downstream system must agree about the destination for the output of the HLS output group. 

When you deliver HLS over HTTP, you are often delivering to an origin server. The origin server typically has clear guidelines about the rules for the destination path, including the file name of the main manifest (the `.M3U8` file).

**To arrange setup of the destination**

You must talk to the operator at the downstream system to coordinate your setup.

1. If the downstream system isn't an Akamai server, find out if it uses PUT or WebDAV. 

1. Find out if the downstream system has special connection requirements. These connection fields are grouped in the console in the **CDN settings** section for the HLS output group. To display this page on the MediaLive console, in the **Create channel** page, in the **Output groups** section, choose **Add**, then choose **HLS**. Choose the group, then in **HLS settings**, open **CDN settings**.

1. Decide if you need two destinations for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

1. Find out if the downstream system uses a secure connection. If it does, arrange with the operator to set up user credentials. 

1. Find out if the downstream system requires custom paths inside the main manifests and the child manifests. For more information, see [Customizing the paths inside HLS manifests](hls-manifest-paths.md).

1. If you are setting up a [standard channel](plan-redundancy.md), find out if the downstream system supports redundant manifests. If so, decide if you want to implement this feature. For more information, see [Creating redundant HLS manifests](hls-redundant-manifests.md), and specifically [Rules for most downstream systems](hls-redundant-manif-most-systems.md) and [Rules for Akamai CDNs](hls-redundant-manif-akamai.md) for specific instructions. 

1. Talk to the operator at the downstream system to agree on a full destination path for the three categories of HLS files (the main manifests, the child manifests, and the media files). MediaLive always puts all three categories of files for each destination in this one location. It’s not possible to configure MediaLive to put some files in another location. 

   If you have two destinations, the destination paths must be different from each other in some way. At least one of the portions of one path must be different from the other. It is acceptable for all the portions to be different. Discuss this requirement with the operator of the downstream system. The downstream system might have specific rules about uniqueness.

1. Talk to the operator at the downstream system about special requirements for the names of the three categories of HLS files. Typically, the downstream system doesn’t have special requirements. 

1. Talk to the operator at the downstream system about special requirements for the modifier on the names of the child manifests and media files. 

   The child manifests and media files always include this modifier in their file names. This modifier distinguishes each output from the other, so it must be unique in each output. For example, the files for the high-resolution output must have a different name from the files for the low-resolution output. For example, the files for one output could have the file name and modifier `curling_high`, while the other output could have `curling_low`.

   Typically, the downstream system doesn’t have special requirements.

1. Ask the operator of the downstream system if the media files should be set up in separate subdirectories. For example, one subdirectory for the first 1000 segments, another subdirectory for the second 1000 segments, and so on.

   Most downstream systems don’t require separate subdirectories.

1. Agree on the portions of the destination path where the downstream system has special requirements.
   + For example, the downstream system might only require that you send to a specific host. The downstream system doesn't need to know about the folder or file names you will use.

     For example, send to two folders that you name, but on the host at `https://203.0.113.55`

     Or send to two folders that you name, but on the hosts at `https://203.0.113.55` and `https://203.0.113.82`
   + Or the downstream system might require a specific host and folder, but with a file name that you choose. For example, this host and folders:

     `https://203.0.113.55/sports/delivery/`

     `https://203.0.113.55/sports/backup/`

1. Make a note of the information you have collected:
   + The connection type for the downstream system – Akamai, PUT, or WebDAV.
   + The settings for connection fields, if the downstream system has special requirements.
   + The protocol for delivery—HTTP or HTTPS.
   + The user name and password to access the downstream system, if the downstream system requires authenticated requests. Note that these user credentials relate to user authentication, not to the protocol. User authentication is about whether the downstream system will accept your request. The protocol is about whether the request is sent over a secure connection.
   + All or part of the destination paths, possibly including the file names.
   + Whether you need to set up separate subdirectories.

# Create an HLS output group
<a name="creating-hls-output-group"></a>

You create the output group and its outputs when you [create or edit a MediaLive channel](creating-a-channel-step4.md). 

## The procedure
<a name="hls-create-procedure"></a>

1. On the **Create channel** page, under **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **HLS**, and then choose **Confirm**. More sections appear:
   + **HLS group destination** – This section contains fields for the destination of the outputs. For more information see the section for the type of downstream system:
     + [Fields for the output destination – sending to Amazon S3](hls-destinations-s3.md)
     + [Fields for the output destination – sending to MediaStore](hls-destinations-ems.md)
     + [Fields for the output destination – sending to MediaPackage](hls-destinations-emp.md)
     + [Fields for the output destination – sending to an HTTP server](hls-destinations-http.md)
   + **HLS settings** – This section contains fields for the [destination of the outputs](hls-destinations-http.md), for [resiliency](hls-other-features.md#hls-resiliency), and for [captions](hls-other-features.md#hls-captions). 
   + **HLS outputs** – This section shows the single output that is added by default.
   + **Location** – This section contains fields for [customizing the paths inside the manifests](hls-manifest-paths.md).
   + **Manifest and segments** – This section contains fields for [configuring redundant manifests](hls-opg-redundant-manifest.md), for configuring the [manifest contents](hls-other-features.md#hls-manifest-contents), and for [configuring media segments](hls-other-features.md#hls-segment-fields).
   + **DRM** – This section contains fields for configuring [encryption of outputs](hls-other-features.md#hls-drm).
   + **Ad marker** – This section contains fields for setting up for [SCTE-35 ad avails](hls-other-features.md#hls-ad-markers).
   + **Captions** – This section contains fields for configuring [captions](hls-other-features.md#hls-captions).
   + **ID3** – This section contains fields for setting up for [ID3](hls-other-features.md#hls-id3).

1. If your plan includes more than one output in this output group, then in **HLS outputs**, choose **Add output** to add the appropriate number of outputs. 

1. In **HLS outputs**, choose the first **Settings** link to view the sections for the first output:
   + **Output settings** – This section contains fields for the destination of the outputs. See these sections:
     + [Fields for the output destination – sending to Amazon S3](hls-destinations-s3.md)
     + [Fields for the output destination – sending to MediaStore](hls-destinations-ems.md)
     + [Fields for the output destination – sending to MediaPackage](hls-destinations-emp.md)
     + [Fields for the output destination – sending to an HTTP server](hls-destinations-http.md)

     This section also contains fields for the [HLS container](hls-container.md).
   + **Stream settings** – This section contains fields for the [output streams](hls-streams-section.md) (the video, audio, and captions).

1. (Optional) Enter names for the output group and the outputs:
   + In **HLS settings**, for **Name**, enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Curling**.
   + In the **HLS outputs** section for each output, for **Name**, enter a name for the output. This name is internal to MediaLive; it doesn't appear in the output. For example, **high resolution**.

1. To complete the other fields, see the topics listed after this procedure.

1. After you have finished setting up this output group and its outputs, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md).

**Topics**
+ [The procedure](#hls-create-procedure)
+ [Destination fields in an HLS output group](hls-destinations.md)
+ [Fields for the HLS container](hls-container.md)
+ [Fields for customizing the paths inside the manifests](hls-custom-manifests.md)
+ [Fields for redundant manifests](hls-opg-redundant-manifest.md)
+ [Fields for the video, audio, and captions streams (encodes)](hls-streams-section.md)
+ [Fields for other HLS features](hls-other-features.md)

# Destination fields in an HLS output group
<a name="hls-destinations"></a>

The HLS output group in MediaLive supports several types of destinations. Each type has different configuration requirements.

**Topics**
+ [Fields for the output destination – sending to Amazon S3](hls-destinations-s3.md)
+ [Fields for the output destination – sending to MediaStore](hls-destinations-ems.md)
+ [Fields for the output destination – sending to MediaPackage](hls-destinations-emp.md)
+ [Fields for the output destination – sending to an HTTP server](hls-destinations-http.md)

# Fields for the output destination – sending to Amazon S3
<a name="hls-destinations-s3"></a>

When you [planned the destinations for the HLS output group](origin-server-hls-s3.md), you might have decided to send the output to Amazon S3. You must design the destination path or paths for the output. You must then enter the different portions of the path into the appropriate fields on the console.

**Topics**
+ [Design the path for the output destination](hls-destinations-s3-design.md)
+ [Complete the fields on the Console](hls-destinations-s3-specify.md)

# Design the path for the output destination
<a name="hls-destinations-s3-design"></a>

Perform this step if you haven't yet designed the full destination path or paths. If you've already designed the paths, go to [Complete the fields on the Console](hls-destinations-s3-specify.md).

**To design the path**

1. Collect the bucket names that you [previously obtained](origin-server-hls-s3.md) from the Amazon S3 user. For example:

   `amzn-s3-demo-bucket`

1. Design the portions of the destination paths that follow the bucket or buckets. For details, see the sections that follow.

**Topics**
+ [The syntax for the paths for the outputs](#hls-syntax-s3)
+ [Designing the folders and baseFilename](#hls-path-s3)
+ [Designing the nameModifier](#hls-nameModifier-design-s3)
+ [Designing the segmentModifier](#hls-segmentModifier-design-s3)

## The syntax for the paths for the outputs
<a name="hls-syntax-s3"></a>

An HLS output always includes three categories of files: 
+ The main manifest
+ The child manifests
+ The media files

The following table describes the parts that make up the destination paths for these three categories of files.

The destination paths for these three categories of files are identical up to and including the *baseFilename*, which means that MediaLive sends all these categories of files to the same folder. The modifiers and file extensions are different for each category of file. When sending to Amazon S3, you must send all the files to the same folder. The downstream systems expect all the files to be together.


| File | Syntax of the path | Example | 
| --- | --- | --- | 
| Main manifest files | protocol bucket path baseFilename extension | The path for a main manifest in the bucket *sports*, with the file name *index*:s3ssl://amzn-s3-demo-bucket/sports/delivery/curling/index.m3u8 | 
| Child manifest files | protocol bucket path baseFilename nameModifier extension | The path for the child manifest for the high-resolution renditions of the curling output`s3ssl://amzn-s3-demo-bucket/sports/delivery/curling/index-high.m3u8` | 
| Media files (segments) | protocol bucket path baseFilename nameModifier optionalSegmentModifier counter extension | The path for the file for the 230th segment might be:s3ssl://amzn-s3-demo-bucket/sports/delivery/curling/index-high-00230.ts | 

These destination paths are constructed as follows:
+ The Amazon S3 user should have provided you with the bucket names.
+ You must determine the following: 
  + The folders
  + The baseFilename
  + The modifier
  + The segmentModifier

  See the sections that follow.
+ MediaLive inserts the underscore before the counter.
+ MediaLiveautomatically generates this counter. Initially, this is a five-digit number starting at 00001, and increasing by 1. So 00001, 00002, 00003 and so on. After 99999, the next number is 100000 (six digits), then 100001, 100002, and so on. Then from 999999 to 1000000 (seven digits), and so on.
+ MediaLive inserts the dot before the extension.
+ MediaLive selects the extension:
  + For manifest files – always `.m3u8`
  + For media files – .ts for files in a transport stream, or .mp4 for files in an fMP4 container 

## Designing the folders and baseFilename
<a name="hls-path-s3"></a>

Design a folder path and baseFilename that suits your purposes. 

If you have two destinations for each output, the destination paths must be different from each other in some way. Follow these guidelines:
+ At least one of the portions of one path must be different from the other. It is acceptable for all the portions to be different. 

  Therefore, if the buckets are *different*, the folder path and file names for the two destinations can be different from each other, or they can be the same. For example:

  `s3ssl://amzn-s3-demo-bucket/sports/delivery/curling/index-high.m3u8`

  `s3ssl://amzn-s3-demo-bucket1/sports/delivery/curling/index-high.m3u8`

  or

  `s3ssl://amzn-s3-demo-bucket/sports/delivery/curling/index-high.m3u8`

  `s3ssl://amzn-s3-demo-bucket1/sports/redundant/curling/index-high.m3u8`
+ If the buckets are *the same*, the folder path and file names for the two destinations must be different from each other. For example:

  `s3ssl://amzn-s3-demo-bucket/sports/delivery/curling/index-high.m3u8`

  `s3ssl://amzn-s3-demo-bucket/sports/redundant/curling/index-high.m3u8`

## Designing the nameModifier
<a name="hls-nameModifier-design-s3"></a>

Design the `nameModifier` portions of the file name. The child manifests and media files include this modifier in their file names. This `nameModifier` distinguishes each output from the other, so it must be unique in each output. Follow these guidelines:
+ For an output that contains video (and possibly other streams), you typically describe the video. For example, **-high** or **-1920x1080-5500kpbs** (to describe the resolution and the bitrate).
+ For an output that contains only audio or only captions, you typically describe the audio or captions. For example, **-aac** or **-webVTT**.
+ It’s a good idea to start the `nameModifier` with a delimiter, such as a hyphen, in order to separate the` baseFilename` from the `nameModifier`.
+ The `nameModifier` can include [data variables](variable-data-identifiers.md).

## Designing the segmentModifier
<a name="hls-segmentModifier-design-s3"></a>

Design the segmentModifiers portion of the destination path. The segmentModifier is optional, and if you include it, only the media file names include it. 

A typical use case for this modifier is to use a data variable to create a timestamp, to prevent segments overriding each other if the channel restarts. For example, assume that you include the timestamp **\$1t\$1-**. Segment 00001 might have the name `index-120028-00001`. If the output restarts a few minutes later (which causes the segment counter to restart), the new segment 00001 will have the name `index-120039-00001`. The new file won't overwrite the file for the original segment 00001. Some downstream systems might prefer this behavior.

# Complete the fields on the Console
<a name="hls-destinations-s3-specify"></a>

After you have designed the output names and destination paths, you can set up the HLS output group.

The following fields configure the location and names of the HLS media and manifest files (the destination).
+ **Output group – HLS group destination** section
+ **Output group – HLS settings – CDN** section
+ **Output group – Location – Directory structure **
+ **Output group – Location – Segments per subdirectory**
+ **HLS outputs – Output settings – Name modifier**
+ **HLS outputs – Output settings – Segment modifier**

**To set the destination for most downstream systems**

1. Complete the **URL** fields in the **HLS group destinations** section. Specify two destinations if the channel is set up as a standard channel, or one destination if it is set up as a single-pipeline channel.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/hls-destinations-s3-specify.html)

1. Leave the **Credentials** section blank in both the **HLS group destinations** sections. MediaLive has permission to write to the S3 bucket via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

1. In the **CDN** settings section, choose `Hls S3`.

1. Complete the **CDN settings** field only if MediaLive must set a canned ACL whenever it sends this output to the Amazon S3 bucket.

   Use of a canned ACL typically only applies if your organization is not the owner of the Amazon S3 bucket. You should have discussed the use of a canned ACL with the bucket owner when you discussed the [destination for the output](origin-server-hls-s3.md#setting-dss-hls-canned-acl).

# Fields for the output destination – sending to MediaStore
<a name="hls-destinations-ems"></a>

When you [planned the destinations for the HLS output group](origin-server-ems.md), you might have decided to send the output to MediaStore. You must design the destination path or paths for the output. You must then enter the different portions of the path into the appropriate fields on the console.

**Topics**
+ [Design the path for the output destination](hls-destinations-ems-design.md)
+ [Complete the fields on the console](hls-specify-destination-ems.md)

# Design the path for the output destination
<a name="hls-destinations-ems-design"></a>

Perform this step if you haven't yet designed the full destination path or paths. If you've already designed the paths, go to [Complete the fields on the console](hls-specify-destination-ems.md).

**To design the path**

1. Collect the data endpoint for the container or containers. You [previously obtained](origin-server-ems.md) this information from the MediaStore user. For example:

   `a23f.data.mediastore.us-west-2.amazonaws.com`

1. Design the portions of the destination paths that follow the data endpoint (for MediaStore). 

**Topics**
+ [The syntax for the paths for the outputs](#hls-syntax-ems)
+ [How MediaLive constructs the paths](#hls-how-construct-urls-ems)
+ [Designing the folders and baseFilename](#hls-path-ems)
+ [Designing the nameModifier](#hls-nameModifier-design-ems)
+ [Designing the segmentModifier](#hls-segmentModifier-design-ems)

## The syntax for the paths for the outputs
<a name="hls-syntax-ems"></a>

An HLS output always includes three categories of files: 
+ The main manifest
+ The child manifests
+ The media files

The following table describes the parts that make up the destination paths for these three categories of files.

The destination paths for these three categories of files are identical up to and including the *baseFilename*, which means that MediaLive sends all these categories of files to the same folder. The modifiers and file extensions are different for each category of file. When sending to MediaStore, you must send all the files to the same folder. The downstream systems expect all the files to be together.


| File | Syntax of the path | Example | 
| --- | --- | --- | 
| Main manifest files | protocol dataEndpoint path baseFilename extension | The path for a main manifest in the path *delivery* in the container, and with the file name *index*:mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/delivery/index.m3u8 | 
| Child manifest files | protocol dataEndpoint path baseFilename nameModifier extension | The path for the child manifest for the high-resolution renditions of the output`mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/delivery/index-high.m3u8` | 
| Media files (segments) | protocol dataEndpoint path baseFilename nameModifier optionalSegmentModifier counter extension | The path for the file for the 230th segment might be:mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/delivery/index-high-00230.ts | 

## How MediaLive constructs the paths
<a name="hls-how-construct-urls-ems"></a>

These paths are constructed as follows:
+ The user of the AWS service should have provided you with the container names.
+ For MediaStore, you must determine the following: 
  + The folders
  + The baseFilename
  + The modifier
  + The segmentModifier

  See the sections that follow.
+ MediaLive inserts the underscore before the counter.
+ MediaLive generates the counter, which is always five digits starting at 00001.
+ MediaLive inserts the dot before the extension.
+ MediaLive selects the extension:
  + For manifest files – always` .m3u8`
  + For media files – .ts for files in a transport stream, or .mp4 for files in an fMP4 container 

## Designing the folders and baseFilename
<a name="hls-path-ems"></a>

Design a folder path and baseFilename that suits your purposes. 

If you have two destinations for each output, the destination paths must be different from each other in some way. Follow these guidelines:
+ At least one of the portions of one path must be different from the other. It is acceptable for all the portions to be different. 

  Therefore, if the buckets or containers are different, the folder path and file names for the two destinations can be different from each other, or they can be the same. For example:

  `mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/delivery/index.m3u8`

  `mediastoressl://fe30.data.mediastore.us-west-2.amazonaws.com/delivery/index.m3u8`

  or

  `mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/delivery/index.m3u8`

  `mediastoressl://fe30.data.mediastore.us-west-2.amazonaws.com/redundant/index.m3u8`
+ If the buckets or containers are the same, the folder path and file names for the two destinations must be different from each other. For example:

  `mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/delivery/index.m3u8`

  `mediastoressl://a23f.data.mediastore.us-west-2.amazonaws.com/redundant/index.m3u8`

## Designing the nameModifier
<a name="hls-nameModifier-design-ems"></a>

Design the `nameModifier` portions of the file name. The child manifests and media files include this modifier in their file names. This `nameModifier` distinguishes each output from the other, so it must be unique in each output. Follow these guidelines:
+ For an output that contains video (and possibly other streams), you typically describe the video. For example, **-high** or **-1920x1080-5500kpbs** (to describe the resolution and the bitrate).
+ For an output that contains only audio or only captions, you typically describe the audio or captions. For example, **-aac** or **-webVTT**.
+ It’s a good idea to start the `nameModifier` with a delimiter, such as a hyphen, in order to separate the` baseFilename` from the `nameModifier`.
+ The `nameModifier` can include [data variables](variable-data-identifiers.md).

## Designing the segmentModifier
<a name="hls-segmentModifier-design-ems"></a>

Design the segmentModifiers portion of the destination path. The segmentModifier is optional, and if you include it, only the media file names include it. 

A typical use case for this modifier is to use a data variable to create a timestamp, to prevent segments overriding each other if the channel restarts. For example, assume that you include the timestamp **\$1t\$1-**. Segment 00001 might have the name `index-120028-00001`. If the output restarts a few minutes later (which causes the segment counter to restart), the new segment 00001 will have the name `index-120039-00001`. The new file won't overwrite the file for the original segment 00001. Some downstream systems might prefer this behavior.

# Complete the fields on the console
<a name="hls-specify-destination-ems"></a>

After you have designed the output names and destination paths, you can set up the HLS output group.

The following fields configure the location and names of the HLS media and manifest files (the destination).
+ **Output group – HLS group destination** section
+ **Output group – HLS settings – CDN** section
+ **Output group – Location – Directory structure **
+ **Output group – Location – Segments per subdirectory**
+ **HLS outputs – Output settings – Name modifier**
+ **HLS outputs – Output settings – Segment modifier**

**To set the destination for most downstream systems**

1. Complete the **URL** fields in the **HLS group destinations** section. Specify two destinations if the channel is set up as a standard channel, or one destination if it is set up as a single-pipeline channel.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/hls-specify-destination-ems.html)

1. Leave the **Credentials** section blank in both the **HLS group destinations** sections. MediaLive has permission to write to the MediaStore container via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

1. In the **CDN** settings section, choose `Hls media store`.

1. If the MediaStore user gave you values to [configure the connection](origin-server-http.md), enter those values in the fields in the **CDN** settings section.

# Fields for the output destination – sending to MediaPackage
<a name="hls-destinations-emp"></a>

When you [planned the output to MediaPackage](hls-choosing-hls-vs-emp.md), you might have decided to send the output by creating an HLS output group. (Or you might have decided to create a [MediaPackage output group](creating-mediapackage-output-group.md).)

You must design the destination path or paths for the output. You must then enter the different portions of the path into the appropriate fields on the console.

You can use an HLS output group to send to standard MediaPackage or toMediaPackage v2. The two versions use different protocols:
+ MediaPackage uses WebDAV.
+ MediaPackage v2 uses Basic PUT.

**Topics**
+ [Design the path for the output destination](hls-destinations-emp-design.md)
+ [Complete the fields on the console](hls-specify-destination-emp.md)
+ [Standard MediaPackage example](hls-example-mediapackage.md)
+ [MediaPackage v2 example](hls-example-mediapackage-v2.md)

# Design the path for the output destination
<a name="hls-destinations-emp-design"></a>

Perform this step if you haven't yet designed the full destination path or paths. If you've already designed the paths, go to [Complete the fields on the console](hls-specify-destination-emp.md).

**To design the path**

1. Collect the information you [previously obtained](origin-server-hls-emp.md) from the MediaPackage user:
   + The two URLs (input endpoints is the MediaPackage terminology) for the channel. See the information after this procedure. 
   + If you are using standard MediaPackage, obtain the user name and password. If you are using MediaPackage v2, you don't use user credentials.

1. You must design the portions of the destination paths that follow the URLs. 

**Topics**
+ [Collect the information for standard MediaPackage](hls-destinations-emp-info.md)
+ [Collect the information for MediaPackage v2](hls-destinations-emp-info-v2.md)
+ [The syntax for the paths for the outputs](hls-syntax-emp.md)
+ [Designing the nameModifier](hls-nameModifier-design-emp.md)
+ [Designing the segmentModifier](hls-segmentModifier-design-emp.md)

# Collect the information for standard MediaPackage
<a name="hls-destinations-emp-info"></a>

For standard MediaPackage, the two URLs for a channel look like these examples:

`6d2c.mediapackage.us-west-2.amazonaws.com/in/v2/9dj8/9dj8/channel` 

`6d2c.mediapackage.us-west-2.amazonaws.com/in/v2/9dj8/e333/channel`

Where:

`mediapackage` indicates that the input endpoints uses version 1 of the MediaPackage API

`channel` always appears at the end of the URL. It is the base filename for all the files for this destination. 

The two URLs are always identical except for the folder just before `channel`.

# Collect the information for MediaPackage v2
<a name="hls-destinations-emp-info-v2"></a>

For MediaPackage v2, the two URLs for a channel look like these examples:

`mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/1/curling/index`

`mz82o4-2.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/2/curling/index`

Where: 


| Element | Description | 
| --- | --- | 
| mz82o4-1 and mz82o4-2 |  Indicate that the two endpoints are for a redundant channel in MediaPackage. The prefixes are always -1 and -2 | 
| mediapackagev2 | Indicates that the input endpoints uses version 2 of the MediaPackage API | 
| live-sports/1/curling and live-sports/2/curling | Folders for the redundant ingests. One folder always includes /1/, and the other folder always includes /2/  | 
| index | Always appears at the end of the URL. It is the base filename for all the files for this destination.  | 

# The syntax for the paths for the outputs
<a name="hls-syntax-emp"></a>

An HLS output always includes three categories of files: 

See the following sections.
+ The main manifest
+ The child manifests
+ The media files

The following table describes the parts that make up the destination paths for these three categories of files.

The destination paths for these three categories of files are identical up to and including the *baseFilename*, which means thatMediaLive sends all these categories of files to the same folder. The modifiers and file extensions are different for each category of file. When sending to MediaPackage, you must send all the files to the same folder. The downstream systems expect all the files to be together.


| File | Syntax of the path | Example | 
| --- | --- | --- | 
| Main manifest files |  protocol channelURL extension |  The path for output. Here is an example that uses MediaPackage v2 `https://mz82o4-2.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/2/curling/index.m3u8`  | 
| Child manifest files | protocol channelURL nameModifier extension | Here is an example for the path for the child manifest for the high-resolution renditions of the curling output (in a destination that uses MediaPackage v2):`https://mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/1/curling/index-high.m3u8` | 
| Media files (segments) | protocol channelURL nameModifier optionalSegmentModifier counter extension | Here is an example for the path for the file for the 230th segment (in a destination that uses MediaPackage v2):https://mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/1/curling/index-high-00230.ts | 

These paths are constructed as follows:
+ The MediaPackage user should have provided you with the channel URLs. The URLs cover the portion of the path up to and including the baseFilename:
  + With standard MediaPackage, the baseFilename is always `channel`. 
  + With MediaPackage v2, the baseFilename is always `index`. 
+ You must specify the following:
  + The modifier
  + The segmentModifier

  See the sections that follow.
+ MediaLive inserts the underscore before the counter.
+ MediaLive generates the counter, which is always five digits starting at 00001.
+ MediaLive inserts the dot before the extension.
+ MediaLive selects the extension:
  + For manifest files – always` .m3u8`
  + For media files – .ts for files in a transport stream, or .mp4 for files in an fMP4 container 

# Designing the nameModifier
<a name="hls-nameModifier-design-emp"></a>

Design the `nameModifier` portions of the file name. The child manifests and media files include this modifier in their file names. 

This `nameModifier` distinguishes each output from the other, so it must be unique in each output. 
+ For an output that contains video (and possibly other streams), you typically describe the video. For example, if you have three renditions, you might use **-high**, **-medium** and **-low**. Or each modifier could accurately describe the resolution and the bitrate (**-1920x1080-5500kpbs**).
+ For an output that contains only audio or only captions, you typically describe the audio or captions. For example, **-aac** or **-webVTT**.

It’s a good idea to start the `nameModifier` with a delimiter, such as a hyphen, in order to separate the` baseFilename` from the `nameModifier`.

The `nameModifier` can include [data variables](variable-data-identifiers.md).

# Designing the segmentModifier
<a name="hls-segmentModifier-design-emp"></a>

Design the segmentModifiers portion of the destination path. The segmentModifier is optional, and if you include it, only the media file names include it. 

A typical use case for this modifier is to use a data variable to create a timestamp, to prevent segments overriding each other if the channel restarts. For example, assume that you include the timestamp **\$1t\$1-**. Segment 00001 might have the name `index-120028-00001`. If the output restarts a few minutes later (which causes the segment counter to restart), the new segment 00001 will have the name `index-120039-00001`. The new file won't overwrite the file for the original segment 00001. Some downstream systems might prefer this behavior.

# Complete the fields on the console
<a name="hls-specify-destination-emp"></a>

After you have designed the output names and destination paths, you can set up the HLS output group.

The following fields configure the location and names of the HLS media and manifest files (the destination).
+ **Output group – HLS group destination** section
+ **Output group – HLS settings – CDN** section
+ **Output group – Location – Directory structure **
+ **Output group – Location – Segments per subdirectory**
+ **HLS outputs – Output settings – Name modifier**
+ **HLS outputs – Output settings – Segment modifier**

**To set the destination**

1. Complete the **URL** fields in the **HLS group destinations** section. Specify two destinations if the channel is set up as a standard channel, or one destination if it is set up as a single-pipeline channel.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/hls-specify-destination-emp.html)

1. Enter the input user name. For the password (if applicable), enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md).

1. In the **CDN** settings section, choose the appropriate connection type:
   + To send to standard MediaPackage, choose `Hls webdav`.
   + To send to MediaPackage v2, choose `Basic PUT`.

1. If the downstream system gave you values to [configure the connection](origin-server-http.md), enter those values in the fields in the **CDN** settings section.

# Standard MediaPackage example
<a name="hls-example-mediapackage"></a>

This example shows how to set up the destination fields if the downstream system for the HLS output group is standard MediaPackage.

Assume that you want to stream the curling game and to create three outputs: high, medium, and low bitrate. 


| Field | Value | 
| --- | --- | 
| CDN settings in HLS settings section | hls webdav  | 
| URL in HLS group destination A section |  6d2c.mediapackage.us-west-2.amazonaws.com/in/v2/9dj8/9dj8/channel | 
| Credentials in HLS group destination A section | MediaPackage accepts only authenticated requests, so you must enter a user name and a password that is known to MediaPackage. For the password, enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md).  | 
| URL in HLS group destination B section |  6d2c.mediapackage.us-west-2.amazonaws.com/in/v2/9dj8/e333/channel | 
| Credentials in HLS group destination B section | Enter a user name and password for the URL for destination B. The credentials are probably the same for both URLs, but they might not be. | 
| Name modifier in HLS outputs section |  Choose **Add output** twice: two more **Output** lines are added to this section, for a total of three lines. In each line, enter a modifier: **-high**, **-medium**, and **-low**.  | 
| Directory Structure and Segments Per Subdirectory in Location section | MediaPackage doesn't use these fields, therefore leave them blank.  | 

As a result, files are created with the following names:
+ One main manifest: **channel.m3u8**
+ One child manifest for each output: **channel-high.m3u8**, **channel-medium.m3u8**, **channel-low.m3u8**
+ TS files for each output: 
  + **channel-high-00001.ts**, **channel-high-00002.ts**, **channel-high-00003.ts**, and so on
  + **channel-medium-00001.ts**, **channel-medium-00002.ts**, **channel-medium-00003.ts**, and so on 
  + **channel-low-00001.ts**, **channel-low-00002.ts**,** channel-low-00003.ts**, and so on

The files will be published to both URL inputs on MediaPackage.

# MediaPackage v2 example
<a name="hls-example-mediapackage-v2"></a>

This example shows how to set up the destination fields if the downstream system for the HLS output group is standard MediaPackage. 

Assume that you want to stream the curling game and to create three outputs: high, medium, and low bitrate. 


| Field | Value | 
| --- | --- | 
| CDN settings in HLS settings section |  **basic PUT**  | 
| URL in HLS group destination A section | mz82o4-1.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/1/curling/index | 
| Credentials in HLS group destination A section | Leave blank. MediaPackage v2 doesn't use credentials to authenticate.  | 
| URL in HLS group destination B section | mz82o4-2.ingest.hnycui.mediapackagev2.us-west-2.amazonaws.com/in/v1/live-sports/2/curling/index. | 
| Credentials in HLS group destination B section | Leave blank. MediaPackage v2 doesn't use credentials to authenticate.  | 
| Name modifier in HLS outputs section |  Choose **Add output** twice: two more **Output** lines are added to this section, for a total of three lines. In each line, enter a modifier: **-high**, **-medium**, and **-low**.  | 
| Directory Structure and Segments Per Subdirectory in Location section | MediaPackage doesn't use these fields, therefore leave them blank.  | 

As a result, files are created with the following names:
+ One main manifest: **index.m3u8**
+ One child manifest for each output: **index-high.m3u8**, **index-medium.m3u8**, **index-low.m3u8**
+ TS files for each output: 
  + **index-high-00001.ts**, **index-high-00002.ts**, **index-high-00003.ts**, and so on
  + **index-medium-00001.ts**, **index-medium-00002.ts**, **index-medium-00003.ts**, and so on 
  + **index-low-00001.ts**, **index-low-00002.ts**,** index-low-00003.ts**, and so on

The files will be published to both URL inputs on MediaPackage.

# Fields for the output destination – sending to an HTTP server
<a name="hls-destinations-http"></a>

When you [planned the destinations for the HLS output group](origin-server-http.md), you might have decided to send the output to an HTTP server. 

You must design the destination path or paths for the output. You must then enter the different portions of the path into the appropriate fields on the console.

**Topics**
+ [Design the path for the output destination](hls-destinations-design-step.md)
+ [Complete the fields on the console](hls-specify-destination.md)
+ [Example for an HTTP or HTTPS server](hls-example-most-downstreamsystems.md)
+ [Akamai example](hls-example-akamai.md)

# Design the path for the output destination
<a name="hls-destinations-design-step"></a>

Perform this step if you haven't yet designed the full destination path or paths. If you've already designed the paths, go to [Complete the fields on the console](hls-specify-destination.md).

**To design the path**

1. Collect the information that you [previously obtained](origin-server-http.md) from the operator of the downstream system:
   + The connection type for the downstream system – Akamai, basic PUT, or WebDAV.
   + The settings for connection fields, if the downstream system has special requirements.
   + The protocol for delivery—HTTP or HTTPS.
   + The user name and password to access the downstream system, if the downstream system requires authenticated requests. Note that these user credentials relate to user authentication, not to the protocol. User authentication is about whether the downstream system will accept your request. The protocol is about whether the request is sent over a secure connection.
   + All or part of the destination paths, possibly including the file names.
   + Whether you need to set up separate subdirectories.

1. As part of the planning with the operator of the downstream system, you should have determined if you want to implement redundant manifests. You should also have determined if the downstream system requires custom manifests. Given these two decisions, read the appropriate section:
   + If you are implementing redundant manifests, see [Creating redundant HLS manifests](hls-redundant-manifests.md), then return to this section.
   + If you are implementing custom paths for manifests, see [Customizing the paths inside HLS manifests](hls-manifest-paths.md), then return to this section.
   + If you are not implementing either of those features, continue keep reading this section.

1. Design the portions of the destination paths that follow the bucket or buckets. For details, see the sections that follow.

**Topics**
+ [The syntax for the paths for the outputs](#hls-syntax-http)
+ [Designing the folders and baseFilename](#hls-baseFilename-design)
+ [Designing the nameModifier](#hls-nameModifier-design)
+ [Designing the segmentModifier](#hls-segmentModifier-design)

## The syntax for the paths for the outputs
<a name="hls-syntax-http"></a>

The following table describes the parts that make up the destination paths for these three categories of files.

The destination paths for these three categories of files are identical up to and including the *baseFilename*, which means thatMediaLive sends all these categories of files to the same folder. The modifiers and file extensions are different for each category of file. 


| File | Syntax of the path | Example | 
| --- | --- | --- | 
| Main manifest files | protocol domain path baseFilename extension | The URL for a main manifest with the file name */index*:http://203.0.113.55/sports/delivery/curling/index.m3u8 | 
| Child manifest files | protocol domain path baseFilename nameModifier extension | The URL for the child manifest for the high-resolution renditions of the output`http://203.0.113.55/sports/delivery/curling/index-high.m3u8` | 
| Media files (segments) | protocol domain path baseFilename nameModifier optionalSegmentModifier counter extension | The URL for the file for the 230th segment might be:http:// 203.0.113.55/sports/delivery/curling/index-high-00230.ts | 

These destination paths are constructed as follows:
+ The operator at the downstream system [should have provided you](origin-server-http.md) with the protocol, domain and part of the path. For example:

  `http://203.0.113.55/sports/`

  The protocol is always HTTP or HTTPS.
+ The operator might have provided the following. Otherwise, you decide them: 
  + The folders
  + The baseFilename
  + The modifier
  + The segmentModifier

  See the sections that follow.
+ MediaLive inserts the underscore before the counter.
+ MediaLive generates the counter, which is always five digits starting at 00001.
+ MediaLive inserts the dot before the extension.
+ MediaLive selects the extension:
  + For manifest files – always` .m3u8`
  + For media files – `.ts` for files in a transport stream, and `.mp4` for files in an fMP4 container 

## Designing the folders and baseFilename
<a name="hls-baseFilename-design"></a>

For the `folder` and `baseFilename` portion of the destination path, follow these guidelines:
+ For a single-pipeline channel, you need only one `baseFilename`.
+ For a standard channel when you are *not *implementing [redundant manifests](hls-opg-redundant-manifest.md), you need two `baseFilenames`. The two `baseFilenames` can be identical or different. Before you create different `baseFilenames`, make sure that the downstream system can work with that setup.
+ For a standard channel when you *are* implementing redundant manifests, see [Fields for redundant manifests](hls-opg-redundant-manifest.md).

## Designing the nameModifier
<a name="hls-nameModifier-design"></a>

Design the `nameModifier` portions of the file name. The child manifests and media files include this modifier in their file names. This `nameModifier` distinguishes each output from the other, so it must be unique in each output. Follow these guidelines:
+ For an output that contains video (and possibly other streams), you typically describe the video. For example, **-high** or **-1920x1080-5500kpbs** (to describe the resolution and the bitrate).
+ For an output that contains only audio or only captions, you typically describe the audio or captions. For example, **-aac** or **-webVTT**.
+ It’s a good idea to include a delimiter, to clearly separate the` baseFilename` from the `nameModifier`.
+ The` nameModifier` can include [data variables](variable-data-identifiers.md).

## Designing the segmentModifier
<a name="hls-segmentModifier-design"></a>

Design the segmentModifiers portion of the destination path. The segmentModifier is optional, and if you include it, only the media file names include it. 

A typical use case for this modifier is to use a data variable to create a timestamp, to prevent segments overriding each other if the channel restarts. For example, assume that you include the timestamp **\$1t\$1-**. Segment 00001 might have the name `/index-120028-00001`. If the output restarts a few minutes later (which causes the segment counter to restart), the new segment 00001 will have the name `/index-120039-00001`. The new file won't overwrite the file for the original segment 00001. Some downstream systems might prefer this behavior.

# Complete the fields on the console
<a name="hls-specify-destination"></a>

The following fields configure the location and names of the HLS media and manifest files (the destination).
+ **Output group – HLS group destination** section
+ **Output group – HLS settings – CDN** section
+ **Output group – Location – Directory structure **
+ **Output group – Location – Segments per subdirectory**
+ **HLS outputs – Output settings – Name modifier**
+ **HLS outputs – Output settings – Segment modifier**

**To set the destination**

1. Complete the **URL** fields in the **HLS group destinations** section. Specify two destinations if the channel is set up as a standard channel, or one destination if it is set up as a single-pipeline channel.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/hls-specify-destination.html)

1. If the downstream system requires user authentication from MediaLive, in each **HLS group destination** section, complete the **Credentials** section. Enter a user name and a password provided by the downstream system. For the password, enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md). 

1. In the **CDN** settings section, choose the option that the downstream system told you to use—Akamai, PUT, or WebDAV.

1. If the downstream system gave you values to [configure the connection](origin-server-http.md), enter those values in the fields in the **CDN** settings section.

# Example for an HTTP or HTTPS server
<a name="hls-example-most-downstreamsystems"></a>

This example shows how to set up the destination fields if the downstream system is an HTTPS server that uses basic PUT. 

Assume that you want to stream the curling game and to create three outputs: high, medium, and low bitrate.


| Field | Value | 
| --- | --- | 
| CDN settings in HLS settings section | Hls basic putChange the other CDN fields according to the instructions from the downstream system.  | 
| URL in HLS group destination A section | For example:**https://203.0.113.55/sports/curling/index** | 
| Credentials in HLS group destination A section | If the downstream system requires authenticated requests, enter the user name provided by the downstream system. For the password, enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md).  | 
| URL in HLS group destination B section | For example:**https://203.0.113.82/sports/curling/index** | 
| Credentials in HLS group destination B section | Enter a user name and password for the URL for destination B, if applicable. The credentials are probably the same for both URLs, but they might not be. | 
| Name modifier in HLS outputs section |  Choose **Add output** twice: two more **Output** lines are added to this section, for a total of three lines. In each line, enter a modifier: **-high**, **-medium**, and **-low**.  | 
| Directory Structure and Segments Per Subdirectory in Location section |  Assume that the downstream system doesn't use these fields.  | 

As a result, files are created with the following names:
+ One main manifest: `index.m3u8`
+ One child manifest for each output: `index-high.m3u8`, `index-medium.m3u8`, `index-low.m3u8`
+ TS files for each output: 
  + `index-high-00001.ts`, `index-high-00002.ts`, `index-high-00003.ts`, and so on
  + `index-medium-00001.ts`, `index-medium-00002.ts`, `index-medium-00003.ts`, and so on 
  + `index-low-00001.ts`, `index-low-00002.ts`, ` index-low-00003.ts`, and so on

The files will be published to two hosts at the downstream system, and in a folder called `sports` on each host.

# Akamai example
<a name="hls-example-akamai"></a>

This example shows how to set up the destination fields if the downstream system is an Akamai server. 

Assume that you want to stream the curling game and to create three outputs: high, medium, and low bitrate. 


| Field | Value | 
| --- | --- | 
| CDN settings in HLS settings section | HLS akamai Select this setting if you are using Akamai Token Authentication. Change the other CDN fields according to the instructions from Akamai.HLS basic put Select this setting if you are using digest authentication. Change the other CDN fields according to the instructions from Akamai. | 
| URL in HLS group destination A section | For example:**https://p-ep50002.i.akamaientrypoint.net/50002/curling/index**Mapping this URL to the Akamai terminology: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/hls-example-akamai.html) | 
| Credentials in HLS group destination A section | If Akamai requires authenticated requests, enter a user name and a password that is known to Akamai. For the password, enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md).  | 
| URL in HLS group destination B section | For example:**https://b-ep50002.i.akamaientrypoint.net/50002-b/curling/index**Mapping this URL to the Akamai terminology: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/hls-example-akamai.html) | 
| Credentials in HLS group destination B section | Enter a user name and password for the URL for the other destination, if applicable. The credentials are probably the same for both URLs, but they might not be. | 
| Name modifier in HLS outputs section |  Choose **Add output** twice: two more **Output** lines are added to this section, for a total of three lines. In each line, enter a modifier: **-high**, **-medium**, and **-low**.  | 
| Directory Structure and Segments Per Subdirectory in Location section |  Complete the fields according to the instructions from Akamai.  | 

As a result, files are created with the following names:
+ One main manifest: **index.m3u8**
+ One child manifest for each output: **index-high.m3u8**, **index-medium.m3u8**, **index-low.m3u8**
+ TS files for each output: 
  + `index-high-00001.ts`, `index-high-00002.ts`, `index-high-00003.ts`, and so on
  + `index-medium-00001.ts`, `index-medium-00002.ts`, `index-medium-00003.ts`, and so on 
  + `index-low-00001.ts`, `index-low-00002.ts`,` index-low-00003.ts`, and so on



The files will be published to two places: 
+ On the Akamai host **p-ep50002.i.akamaientrypoint.net** in a folder called **50002**
+ On the host **b-ep50002.i.akamaientrypoint.net** in a folder called **50002-b**

# Fields for the HLS container
<a name="hls-container"></a>

The following fields configure the container in each output.
+ **HLS outputs** –** Output settings **– **HLS settings** section

These fields control the content of the manifest and structure of the segments. By comparison, fields described in [Fields for contents of manifests](hls-other-features.md#hls-manifest-contents) control how many manifests and segments are in the output.

**To configure the container**

1. In **HLS Settings**, choose the appropriate option. For information on the options, see the list after this procedure.

1. For **Standard hls**, more fields appear. Choose **Transport/container configuration** and **PID settings**. More fields appear.

1. Change any fields. Typically, you change the fields in these two sections only if the downstream system provides you with values.

**About HLS containers**

MediaLive supports these types of containers:
+ **Standard hls** – Choose this type of container if you want to package the streams (encodes) in a transport stream (TS). Choose this container type for all the outputs in the output group (except for outputs that are part of an audio rendition group). Each output might contain these encodes:
  + One video encode
  + One video encode with embedded captions
  + One video encode (and optionally embedded captions) and one or more audio encodes
  + One captions encode
+ **Fmp4 hls** – Choose this type of container if you want to package the streams (encodes) as fragmented MP4. Choose this container type for all the outputs in the output group (except for outputs that are part of an audio rendition group). Each output might contain these encodes:
  + One video encode
  + One video encode with embedded captions
  + One captions encode
+ **Audio-only** – Choose this type of container for each audio-only output that is part of an audio rendition group. The rendition group can be part of a TS (transport stream) or part of an fMP4 package. For information about creating an audio rendition group, see [Audio rendition groups for HLS](audio-renditions.md).
+ **Frame capture** – Choose this type of container to create a JPEG file of frame captures in the output group. This container is used to implement trick-play. For more information about this feature and for instructions on setting it up in the channel, see [Trick-play track via the Image Media Playlist specification](trick-play-roku.md).

# Fields for customizing the paths inside the manifests
<a name="hls-custom-manifests"></a>

Inside the main manifest, there are paths to each child manifest. Inside each child manifest, there are paths to the media files for that manifest. 

You can optionally change the syntax of these paths. Typically, you only need to change the syntax if the downstream system has special path requirements.

The following fields relate to custom paths inside the manifests:
+ **HLS output group – Location** – the **Base URL content** fields. 
+ **HLS output group – Location** – the **Base URL manifest** fields. 

For more information about setting up custom paths in manifests, see [Customizing the paths inside HLS manifests](hls-manifest-paths.md).

# Fields for redundant manifests
<a name="hls-opg-redundant-manifest"></a>

MediaLive supports redundant manifests as specified in the HLS specification. You can enable this feature in a standard channel. 

The following fields relate to redundant manifests:
+ **HLS output group – Manifests and Segments – Redundant manifests** field
+ **HLS output group – Location – the Base URL manifest** fields
+ **HLS output group – Location – the Base URL content** fields

You can’t enable this feature in an HLS output group that has MediaPackage as the downstream system.

For more information about setting up for redundant manifests, see [Creating redundant HLS manifests](hls-redundant-manifests.md).

# Fields for the video, audio, and captions streams (encodes)
<a name="hls-streams-section"></a>

The following fields relate to the encoding of the video, audio, and captions encodes in each output. 
+ **Stream settings** section

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

# Fields for other HLS features
<a name="hls-other-features"></a>

**Topics**
+ [Fields for connection retries](#hls-reconnection-fields)
+ [Fields for contents of manifests](#hls-manifest-contents)
+ [Fields for segments](#hls-segment-fields)
+ [Fields for resiliency](#hls-resiliency)
+ [Fields for DRM](#hls-drm)
+ [Fields for SCTE-35 ad avails](#hls-ad-markers)
+ [Fields for captions](#hls-captions)
+ [Fields for ID3 metadata](#hls-id3)

## Fields for connection retries
<a name="hls-reconnection-fields"></a>

The following fields in the **Output group – HLS settings – CDN settings** section configure the behavior for reconnecting to the downstream system:
+ **Connection retry interval**
+ **Num retries**
+ **Filecache duration**
+ **Restart delay**

For details about a field, choose the **Info** link next to the field in the MediaLive console. 

## Fields for contents of manifests
<a name="hls-manifest-contents"></a>

The following fields in the **HLS output group – Manifests and Segments** section configure the information to include in the HLS child manifests:
+ **Output selection**
+ **Mode**
+ **Stream inf resolution**
+ **Manifest duration format**
+ **Num segments**
+ **I-frame only playlists** – This field is used to implement trick-play via I-frames. For more information, see [Trick-play track via I-frames](trick-play-i-frames.md).
+ **Program date time (PDT)** – This field is used to include or exclude the `EXT-X-PROGRAM-DATE-TIME` tag in manifest files. The tag information helps downstream players to synchronize the stream to the source that's selected in the **PDT clock** field.
+ **Program date time (PDT) period** – This field is used to set the time interval for insertion of `EXT-X-PROGRAM-DATE-TIME` tags, in seconds.
+ **Program date time (PDT) clock** – This field is used to select the time source of the PDT. Output timecode or UTC time can be selected.
+ **Client cache**
+ **Timestamp delta microseconds**
+ **Codec specification**
+ **Manifest compression**

For details about a field, choose the **Info** link next to the field in the MediaLive console. 

## Fields for segments
<a name="hls-segment-fields"></a>

The following fields configure media segments in the output.
+ The following fields in the **HLS output group – Manifests and Segments** section:
  + **TS file mode**
  + **Segment length**
  + **Keep segments**
  + **Min segment length**
+ **HLS outputs** – **Output settings** – **H.265 Packaging type**. This field applies only to fMP4 outputs. MediaLive ignores the value in this field for other types. 

For details about a field, choose the **Info** link next to the field. 

## Fields for resiliency
<a name="hls-resiliency"></a>

The following field relates to implementing resiliency in an HLS output. 
+ **HLS output group** – **HLS Settings** section – **Input loss action**

Optionally change the value of **Input loss action**.

**Setting up for most downstream systems**

If you're sending this HLS output to a downstream system other than AWS Elemental MediaPackage, choose the **Info** link to decide which option to choose. For more information, see [Handling loss of video input](feature-input-loss.md).

**Setting up for MediaPackage**

If you're sending this HLS output to AWS Elemental MediaPackage, set this field to match how you set the [channel class](channel-class.md):
+ If the channel is a standard channel (to support input redundancy on MediaPackage), set this field to **PAUSE\$1OUTPUT**. 

  With this setup, if MediaLive stops producing output on one pipeline, MediaPackage detects the lack of content on its current input and switches to the other input. Content loss is minimized. 

  (If you set this field to **EMIT\$1OUTPUT**, MediaLive sends filler frames to MediaPackage. MediaPackage doesn't consider filler frames to be lost content, and therefore doesn't switch to its other input.)
+ If the channel is a single-pipeline channel, set this field to **EMIT\$1OUTPUT**. 

  With this setup, if the pipeline fails in MediaLive then MediaPackage continues delivering to its own downstream system (although the content will be filler frames). 

  (If you set this field to **PAUSE\$1OUTPUT**, MediaPackage stops updating its endpoint, which might cause problems at the downstream system.)

## Fields for DRM
<a name="hls-drm"></a>

Complete the **DRM **section only if you are setting up for DRM using a static key to encrypt the output. 
+ In **Key provider** settings, choose **Static key**.
+ Complete the other fields as appropriate. For details about a field, choose the **Info** link next to the field. 

In a static key setup, you enter an encryption key in this section (along with other configuration data) and then give that key to the other party (for example, by sending it in an email). A static key is not really a DRM solution and is not highly secure.

MediaLive supports only a static key as an encryption option. To use a DRM solution with a key provider, you must deliver the output to AWS Elemental MediaPackage, by creating a[ MediaPackage output group](creating-mediapackage-output-group.md) instead of an HLS output group. You then encrypt the video using MediaPackage. For more information, see the AWS Elemental MediaPackage User Guide. 

## Fields for SCTE-35 ad avails
<a name="hls-ad-markers"></a>

Complete the **Ad markers** section if you plan to include SCTE-35 messages in the output and to decorate the HLS manifest. See [Processing SCTE 35 messages](scte-35-message-processing.md) and specifically [Enabling passthrough for HLS outputs](scte-35-passthrough-or-removal.md#procedure-to-enable-passthrough-hls).

## Fields for captions
<a name="hls-captions"></a>

The following fields relate to embedded captions in an HLS output. If your plan includes creating at least one embedded captions encode in this HLS output, then the following fields apply:
+ In the **Captions** section, the **Caption language setting**.

  You can optionally set up the HLS manifest to include information about the languages of the embedded captions. 
+ **HLS settings** section – **Caption language mappings**

  You can optionally set up the HLS manifest to include information about each CC (caption channel) number and language.

For detailed instructions about both these fields, see [Language information in HLS manifests](set-up-the-hls-manifest.md).

## Fields for ID3 metadata
<a name="hls-id3"></a>

Complete the **ID3 **section if you want to insert timed ID3 metadata or ID3 segment tags into all the outputs in this output group. For detailed instructions, see [Inserting ID3 timed metadata when creating the MediaLive channel](insert-timed-metadata.md).

# Creating a MediaConnect Router output group
<a name="opg-mediaconnect-router"></a>

When you create a AWS Elemental MediaLive channel, you might want to include a MediaConnect Router output group. For information about the use cases for a MediaConnect Router output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

**Topics**
+ [Organize encodes](design-mediaconnect-router-package.md)
+ [Coordinate with downstream system](downstream-system-mediaconnect-router.md)
+ [Create output group](creating-mediaconnect-router-output-group.md)

# Organize encodes in a MediaConnect Router output group
<a name="design-mediaconnect-router-package"></a>

A MediaConnect Router output group uses the M2TS (MPEG-2 Transport Stream) container. Each output can contain the following:
+ One video encode.
+ Zero or more audio encodes.
+ Zero or more captions encodes. The captions are embedded captions or sidecar captions.

You can have up to five outputs per MediaConnect Router output group.

# Coordinate with the downstream system for a MediaConnect Router output group
<a name="downstream-system-mediaconnect-router"></a>

One advantage of MediaConnect Router is that you don't need to create any AWS Elemental MediaConnect resources before creating the MediaLive output. When you create a MediaLive channel with a MediaConnect Router output group, the outputs automatically appear as options in the MediaConnect Router API.

MediaConnect Router outputs support encryption for data in transit. You can choose one of the following encryption modes:
+ **AUTOMATIC** – The services handle encryption seamlessly using a service-managed secret. This is the recommended option.
+ **SECRETS\$1MANAGER** – You provide the ARN of an AES-256 secret stored in AWS Secrets Manager. The secret must exist before you create the MediaLive channel.

You must specify the Availability Zones for the output group. For a single-pipeline channel, specify one Availability Zone. For a standard channel, specify two different Availability Zones to provide zonal resiliency.

**Important**  
If a MediaConnect Router resource has already been created, the Availability Zones you specify must match those of the existing resource. If the MediaConnect Router resource has not been created yet, the resource must be configured to match the Availability Zones you specify here.

You can use a MediaConnect Router input with a MediaConnect Router output to process video in MediaLive (for example, to normalize frame rate) and then pass the video back into MediaConnect Router. By design, when you use MediaConnect Router inputs and outputs, your entire transport workflow is end-to-end encrypted.

# Create a MediaConnect Router output group
<a name="creating-mediaconnect-router-output-group"></a>

You create the output group and its outputs when you [create or edit a MediaLive channel](creating-a-channel-step4.md). 

1. On the **Create channel** or **Edit channel** page, in **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **MediaConnect Router Output Group**, and then choose **Confirm**. More sections appear:
   + **MediaConnect Router Output Group** destination – This section contains fields for the destination of the outputs. In the Output Destinations section, a **MediaConnect Router Output Group** tab appears. The encryption type defaults to **AUTOMATIC**. To use a secret from AWS Secrets Manager, change the encryption type to **SECRETS\$1MANAGER** and enter the secret ARN.
   + **MediaConnect Router settings** – This section contains fields for configuring the output group. See later in this section.
   + **MediaConnect Router outputs** – This section shows the single output that is added by default. You can add more outputs (up to five per output group), and you can add video, audio, and captions encodes in each output. See later in this section.

**Topics**
+ [Fields in MediaConnect Router settings section](#mediaconnect-router-opg-settings)
+ [Fields for the video, audio, and captions streams (encodes)](#mediaconnect-router-opg-streams-section)

## Fields in MediaConnect Router settings section
<a name="mediaconnect-router-opg-settings"></a>


| Field | Description | 
| --- | --- | 
| Name | A name for the output group. This name is internal to MediaLive. It doesn't appear in the output. | 
| Availability Zones | The Availability Zones for the output group. For a single-pipeline channel, specify one Availability Zone. For a standard channel, specify two different Availability Zones. The two Availability Zones must be different to provide zonal resiliency. | 
| Connected Router Inputs | A read-only field that shows the MediaConnect Router inputs that are connected to this output. This information is purely informational. To connect or disconnect MediaConnect Router inputs, use the MediaConnect Router API. | 

## Fields for the video, audio, and captions streams (encodes)
<a name="mediaconnect-router-opg-streams-section"></a>

1. In **MediaConnect Router outputs**, choose **Add output** to add outputs.

1. Choose the first **Settings** link to view the first output. Each output has two sections: **Output settings** and **Stream settings**.

1. Complete **Output settings**:
   + **Output name**: Change the randomly generated name to a meaningful name. This name is internal to MediaLive; it doesn't appear in the output. 
   + **Name modifier**: MediaLive assigns a sequential modifier to each output in the output group: **\$11**, **\$12**, and so on. Change the name if you want. 

1. In **Output settings**, for **Container settings**, the container is set to M2TS. For information about M2TS settings, see the M2TS fields in [Fields for the UDP transport](udp-container.md).

1. Complete **Stream settings**. This section contains fields for the output encodes (the video, audio, and captions) to create in the output. For information about creating encodes, see the following sections:
   + [Set up the video encode](creating-a-channel-step6.md)
   + [Set up the audio encodes](creating-a-channel-step7.md)
   +  [Set up the captions encodes](creating-a-channel-step8.md)

# Creating a MediaPackage output group
<a name="opg-mediapackage"></a>

When you create a MediaLive channel, you might want to include a MediaPackage output group. For information about the use cases for a MediaPackage output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md). For information about choosing between an HLS and MediaPackage output group, see [Choosing between the HLS output group and MediaPackage output group](hls-choosing-hls-vs-emp.md).

**Topics**
+ [Organize encodes in a MediaPackage output group](design-emp-hls-package.md)
+ [Coordinate with the MediaPackage operator](origin-server-emp.md)
+ [Create a MediaPackage output group](creating-mediapackage-output-group.md)

# Organize encodes in a MediaPackage output group
<a name="design-emp-hls-package"></a>

An MediaPackage output group is typically set up as a video ABR stack. A video ABR stack is an output group that contains the following:
+ More than one outputs.

Each output can contain the following:
+ One video encode (rendition). Typically, each video encode is a different resolution. 
+ Zero or more audio encodes. 
+ Zero or more captions encodes. The captions are embedded or object-style captions.

This diagram illustrates a MediaPackage output group when the captions are embedded in the video. Each video encode is in a separate output. The captions are in each video output. Each audio encode is in a separate output.

![\[Output group diagram showing video outputs with embedded captions and separate audio outputs.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output13-ABR-2Ve-2Asep.png)


This diagram illustrates a MediaPackage output group when the captions are sidecar captions. Each encode is in its own output.

![\[Output group diagram showing six outputs: two V, two A, and two C, representing video, audio, and captions.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output14-ABR-2V-2Asep-2C.png)


# Coordinate with the MediaPackage operator
<a name="origin-server-emp"></a>

You and the operator of the AWS Elemental MediaPackage service must agree about the destination for the output of your MediaPackage output group.

**Note**  
You can send to AWS Elemental MediaPackage by creating a MediaPackage output group or by creating an HLS output group. See [Choosing between the HLS output group and MediaPackage output group](hls-choosing-hls-vs-emp.md) for a description of the differences.

## MediaPackage v1 (HLS) coordination
<a name="coordinate-emp-v1"></a>

**To arrange setup of the MediaPackage v1 destination**

1. Ask the MediaPackage user to create one channel. Even if the MediaLive channel is a [standard channel](plan-redundancy.md) (with two pipelines), you need only one MediaPackage channel.

1. Obtain the ID of the MediaPackage channel. For example, `curling-live`. The channel ID is case sensitive. 

## MediaPackage v2 (CMAF) coordination
<a name="coordinate-emp-v2"></a>

**To arrange setup of the MediaPackage v2 destination**

1. Ask the MediaPackage user to create MediaPackage v2 channels in the required regions. Obtain the following information for each destination:
   + AWS region name (for example, `us-east-1` or `eu-west-1`)
   + MediaPackage channel group name
   + MediaPackage channel name
   + Which ingest endpoint (ENDPOINT\$11 or ENDPOINT\$12) is the preferred input for the MediaPackage channel

1. If you plan to use additional destinations for redundancy or cross-region delivery, coordinate the setup of additional MediaPackage v2 channels as needed.

**Note**  
You don't need user credentials to send a MediaPackage output group to MediaPackage. MediaLive has permission to write to MediaPackage via the trusted entity. Someone in your organization should have already set up these permissions. For more information, see [Access requirements for the trusted entity](trusted-entity-requirements.md).

# Create a MediaPackage output group
<a name="creating-mediapackage-output-group"></a>

When you [planned the workflow for your channel](identify-downstream-system.md), you might have determined that you want to include a MediaPackage output group. (Or you might have decided to use an [HLS output group to deliver to MediaPackage](hls-destinations-emp.md).)

## Create MediaPackage output groups
<a name="emp-create-procedure"></a>

You can create MediaPackage output groups for two different MediaPackage versions:
+ **MediaPackage v1 (HLS)** - Uses HLS ingest protocol and requires a MediaPackage channel ID
+ **MediaPackage v2 (CMAF)** - Uses CMAF ingest protocol and requires MediaPackage channel group name and channel name

### MediaPackage v1 (HLS) procedure
<a name="emp-v1-procedure"></a>

1. On the **Create channel** page, in the **Output groups** section, choose **Add**. The content pane changes to show the **Add output** group section. 

1. Choose **MediaPackage**, and then choose **Confirm**. More sections appear: 
   + **MediaPackage destination**
   + **MediaPackage settings**
   + **MediaPackage outputs**–This section shows the single output that is added by default.

1. In the **MediaPackage destination** section, for **MediaPackage channel ID**, enter the channel ID for that channel. For example, `curling-live`.

1. (Optional) In the **MediaPackage settings** section, for **Name**, enter a name for the output group.

1. If you need to specify MediaPackage V2 group settings select it from the dropdown and specify settings as needed

1. If your plan includes more than one output in this output group, then in **MediaPackage outputs**, choose **Add output** to add the appropriate number of outputs.

   You might want to add an output in order to implement trick-play. For more information about this feature and for instructions on setting it up in the channel, see [Trick-play track via the Image Media Playlist specification](trick-play-roku.md).

1. Choose the first **Settings** link to view the sections for the first output. The section contains fields for the [output streams](hls-streams-section.md) (the video, audio, and captions).

1. [Save the channel](creating-a-channel-step9.md).

### MediaPackage v2 (CMAF) procedure
<a name="emp-v2-procedure"></a>

1. On the **Create channel** page, in the **Output groups** section, choose **Add**. The content pane changes to show the **Add output** group section. 

1. Choose **MediaPackage**, and then choose **Confirm**. More sections appear: 
   + **MediaPackage destination**
   + **MediaPackage settings**
   + **MediaPackage outputs**–This section shows the single output that is added by default.

1. In the **MediaPackage destination** section, configure the primary destination:

   1. For **Region**, select the region that contains your MediaPackage v2 channel. This defaults to your current region.

   1. For **MediaPackage channel group name**, select the MediaPackage channel group name that contains your MediaPackage v2 channel.

   1. For **MediaPackage channel name**, select your MediaPackage v2 channel.

   1. For **Endpoint ID**, select which MediaPackage ingest endpoint should receive content:
      + **ENDPOINT\$11** - Content is sent to the first ingest endpoint
      + **ENDPOINT\$12** - Content is sent to the second ingest endpoint

1. (Optional) To configure additional destinations for redundancy or cross-region delivery, expand the **Additional destinations** section and click **Add destination**. For each additional destination, repeat the configuration steps above, specifying the region, channel group name, channel name, and endpoint ID for each additional MediaPackage channel. Standard channels support up to two additional destinations, while single pipeline channels support one additional destination.

1. (Optional) In the **MediaPackage settings** section, for **Name**, enter a name for the output group.

1. If your plan includes more than one output in this output group, then in **MediaPackage outputs**, choose **Add output** to add the appropriate number of outputs.

1. Choose the first **Settings** link to view the sections for the first output. The section contains fields for the [output streams](hls-streams-section.md) (the video, audio, and captions). CMAF ingest outputs only allow a single stream type per output.

1. [Save the channel](creating-a-channel-step9.md).

# Streams section
<a name="mediapackage-encode-packaging"></a>

The following fields relate to the encoding of the video, audio, and captions streams (encodes) in the output. 
+ **Stream settings** section

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

## Packaging of video encodes and audio-only encodes
<a name="mediapackage-audio-rendition-handling"></a>

MediaLive handles the packaging of encodes within each output as follows:
+ If an output contains both video and audio (and optionally captions), the audio rendition is marked as **program audio**.
+ If an output doesn't contain video, the audio rendition is marked as **audio only** and each audio encode is marked as **ALTERNATE\$1AUDIO\$1NOT\$1AUTO\$1SELECT**.

## Setting the width and height of the video
<a name="mediapackage-width-height"></a>

This section refers to the fields in **Stream settings**, **Video**.

You must specify values in **Width** and **Height**. The MediaPackage output group doesn't support leaving these fields blank to use the width and height from the source video.

## Setting the aspect ratio of the video
<a name="mediapackage-aspect-ratio"></a>

This section refers to the fields in **Stream settings**, **Video**, **Aspect ratio**.

You must set **PAR control** to **SPECIFIED**. The MediaPackage output group doesn't support setting the aspect ratio of the output to follow the source video. When you choose **SPECIFIED**, you must complete **PAR numerator** and **PAR denominator**. You can set the **AFD** fields as you want.

## Setting the frame rate of the video
<a name="mediapackage-framerate"></a>

This section refers to the fields in **Stream settings**, **Video**, **Frame rate**.

You must set **Framerate control** to **SPECIFIED**. The MediaPackage output group doesn't support setting the frame rate of the output to follow the source video. When you choose **SPECIFIED**, you must complete **Framerate numerator** and **Framerate denominator**. You can set the scan type as you want; it doesn't relate directly to the frame rate.

## Setting up for GOPs and segments
<a name="mediapackage-gop-segments"></a>

This section refers to the fields in **Stream settings**, **Video**, **GOP structure**.

For the video, you must set the GOP size to ensure that the output from MediaLive has a segment size that is close to the segment size that you specify in MediaPackage. MediaLive and MediaPackage work together to obtain a final segment size. The logic is as follows:
+ In MediaLive you specify the **GOP size** and **GOP size units** fields.
+ MediaLive calculates the GOP duration, taking into account the frame rate that you specify in the **Video** section of the **Output **page.
+ In MediaPackage you specify the segment duration. You always specify a whole number. This segment duration is the *desired *minimum duration. 
+ When MediaPackage receives the video from MediaLive, it determines how much it must adjust the segment duration to fit a whole number of GOPs into the segment. The segment duration can only be adjusted up, never down. This adjusted segment duration appears in the manifest that MediaPackage produces.

**Example 1**

Assume that in MediaLive you set the GOP size to 60 frames. You set the frame rate to 29.97. These two values result in a GOP duration of 2.002 seconds.

Assume that in MediaPackage you set the segment duration to 6 seconds. This segment duration is the *desired* minimum duration.

When MediaPackage receives the video from MediaLive, it determines how much it must adjust the segment duration to fit a whole number of GOPs into the segment. In this case, the segment duration must be adjusted to 6.006 seconds (three GOPs, where each GOP is 2.002 seconds long). 

**Example 2**

Assume that in MediaLive, you set the GOP size to 90 frames. You set the frame rate to 30. These two values result in a GOP duration of 3 seconds.

Assume that in MediaPackage you set the segment duration to 4 seconds. This segment duration is the *desired* minimum duration.

When MediaPackage receives the video from MediaLive, it determines how much it must adjust the segment duration to fit a whole number of GOPs into the segment. In this case, the segment duration must be adjusted to 6 seconds (two GOPs, where each GOP is 3 seconds long).

## Other encode fields
<a name="mediapackage-general-encode-settings"></a>

For information about the fields in each type of encode, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

# Result of this procedure
<a name="mediapackage-create-result"></a>

With a MediaPackage output group, you don't configure as many fields as you do with a regular HLS output group. Instead, MediaLive automatically sets up the output group as follows:

**Destination**
+ The output from pipeline 0 is mapped to the first ingest endpoint in the MediaPackage channel. The output from pipeline 1 (if you have set up a standard channel) is mapped to the second ingest endpoint.

  The mapping of each pipeline to an ingest endpoint never changes. The only change that can occur in the mappings is if you upgrade a single-pipeline input to a standard-class input, or upgrade a single-pipeline channel to a standard channel. In both these cases, pipeline 1 will be mapped to the second ingest endpoint (which has always existed).

  You can view details of the mappings after you have created the channel. Follow the steps in [Viewing channel details](https://docs.aws.amazon.com/mediapackage/latest/ug/channels-view) in the *AWS Elemental MediaPackage User Guide*. In the **Inputs** section, the first item (ingest endpoint) always maps to pipeline 0 in the MediaLive channel, and the second item always maps to pipeline 1.
+ The output is delivered to MediaPackage using WebDAV. The output is always a live stream, not a VOD stream.
+ The output name or names are automatically set to `Output n`, where n is an integer starting at 1. 
+ The `nameModifier` for each output is automatically set to match the output name.

**Container**
+ The codec specification is RFC 4281. The player device might use this information.
+ The program date time (PDT) period is set to 1 second.
+ The PAT interval is set to 0, which means a single PAT is inserted at the beginning of each segment.
+ The PMT interval is set to 0, which means a single PMT is inserted at the beginning of each segment.

**Resiliency**
+ Resiliency is handled as follows. If input into MediaLive is lost, then the behavior is for MediaLive to pause delivery. MediaPackage expects this behavior and handles the loss by switching to the other input.

**SCTE-35**
+ Passthrough of SCTE-35 messages is always enabled. If you don't want SCTE-35 markers in the outputs, you can remove them in the channel in AWS Elemental MediaPackage. For information about SCTE-35 handling in a MediaPackage output, see [Processing SCTE 35 messages](scte-35-message-processing.md).

**ID3**
+ ID3 metadata is enabled.
+ The ability to insert ID3 markers through the output group is disabled. However, you can set up to pass through ID3 markers that are in the input, and you can insert ID3 markers using the MediaLive schedule. For information about ID3 handling in a MediaPackage output, see [Working with ID3 metadata](id3-metadata.md).

# Creating a Microsoft Smooth output group
<a name="opg-mss"></a>

When you create a AWS Elemental MediaLive channel, you might want to include a Microsoft Smooth output group. For information about the use cases for a Microsoft Smooth output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

**Topics**
+ [Organize encodes in a Microsoft Smooth output group](organize-mss-package.md)
+ [Coordinate with the downstream system](origin-server-mss.md)
+ [Create a Microsoft Smooth output group](creating-smooth-output-group.md)

# Organize encodes in a Microsoft Smooth output group
<a name="organize-mss-package"></a>

A Microsoft Smooth output group is typically set up as a video ABR stack. A video ABR stack is an output group that contains the following:
+ More than one outputs.

Each output can contain the following:
+ One video encode (rendition). Typically, each video encode is a different resolution.  
+ One or more audio encodes.
+ One or more captions encodes. The captions are always sidecar format.

There are two ways to organize the encodes, depending on whether the audio encodes must be bundled or each in their own rendition. You should have already [obtained this information](identify-dss-video-audio.md) from your downstream system.

**Downstream players that require bundled audio**

Plan for the output group to contain the following:
+ One output for each video encode. This output holds one video encode, all the audio encodes, and all the captions encodes (if the captions are embedded). 

  The same audio encodes will appear in each output. For example, the English and French encodes will appear in the high-resolution output, then the same English and French encodes will appear in the low-resolution output.
+ One output for each captions encode. Sidecar captions always go in their own output.

This diagram illustrates a Microsoft output group with bundled audio.

![\[Output group diagram showing V, A, A components bundled with V, A, A, and separate C, C outputs.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output12-ABR-2V-2A-2C.png)


**Downstream players that require separate audio**

Plan for the output group to contain the following:
+ One output for each video encode. This output holds one video and all the captions encodes (if the captions are embedded). 
+ One output for each audio encode.

  The audio encodes might be for different languages, or they might be for different bitrates, or they might be for different languages and bitrates.
+ One output for each captions encode. Sidecar captions always go in their own output.

The arrangement of the audio encodes in this output group is called an *audio rendition group*.

This diagram illustrates a Microsoft Smooth output group with an audio rendition group.

![\[Output group containing six outputs: two V, two A, and two C, arranged in a row.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output14-ABR-2V-2Asep-2C.png)


# Coordinate with the downstream system
<a name="origin-server-mss"></a>

You and the operator of the downstream system must agree about the destination for the output of the Microsoft Smooth output group.

1. Decide if you need two destinations for the output: 
   + You need two destinations in a [standard channel](plan-redundancy.md).
   + You need one destination in a single-pipeline channel.

1. Talk to the operator at the Microsoft IIS server to agree on a full path for the output. Make a note of the URLs that you agree on. For example:

   `https://203.0.113.55/sports/curling`

   `https://203.0.113.82/sports/curling`

1. Arrange with the operator to set up user credentials, if the protocol is HTTPS. 

1. Find out if the downstream system has special connection requirements. These connection fields are in the **General configuration** section for the Microsoft Smooth output group. To display this page on the MediaLive console, in the **Create channel** page, in **Output groups** section, choose **Add**, then choose **Microsoft Smooth**. Choose the group, then in **Microsoft Smooth settings**, open **General configuration**.

# Create a Microsoft Smooth output group
<a name="creating-smooth-output-group"></a>

When you [planned the workflow for your channel](identify-downstream-system.md), you might have determined that you want to include a Microsoft Smooth output group.

## The procedure
<a name="smooth-create-procedure"></a>

1. On the **Create channel** page, in the **Output groups** section, choose **Add**. 

1. In the **Add output group** section, choose **Microsoft Smooth**, and then choose **Confirm**. More sections appear:
   + **Microsoft Smooth group destination** – This section contains fields for the [destination of the outputs](smooth-destinations.md).
   + **Microsoft Smooth settings** – This section contains fields for the [container](smooth-container.md), the [connection to the downstream system](smooth-destinations.md), and [resiliency](mss-other-fields.md#smooth-resiliency). 
   + **Microsoft Smooth outputs** – This section shows the single output that is added by default.
   + **Event configuration** – This section contains fields for the [destination of the outputs](smooth-destinations.md) and the[container](smooth-container.md).
   + **Timecode configuration** – This section contains fields for the [timecode](mss-other-fields.md#smooth-timecode) in the outputs.
   + **Sparse track** – This section contains fields for the [container](smooth-container.md).

1.  If your plan includes more than one output in this output group, then in **Microsoft Smooth outputs**, choose **Add output** to add the appropriate number of outputs. 

1. In **Microsoft Smooth outputs**, choose the first **Settings** link to view the sections for the first output:
   + **Output settings** – This section contains fields for the [output destination](smooth-destinations.md), and the [container](smooth-container.md).
   + **Stream settings** – This section contains fields for the [output streams](smooth-streams-section.md) (the video, audio, and captions).

1. (Optional) Enter names for the output group and the outputs:
   + In **Microsoft Smooth settings**, for **Name**, enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Curling**.
   + In the **Output settings** section for each output, for **Output name**, enter a name for the output. This name is internal to MediaLive; it doesn't appear in the output. For example, **high resolution**.

1. To complete the other fields, see the topics listed after this procedure.

1. After you have finished setting up this output group and its outputs, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md).

**Topics**

# Fields for the output destination
<a name="smooth-destinations"></a>

The following fields configure the destination of each Microsoft Smooth output.
+ **Output group** – **Microsoft Smooth group destination** section
+ **Output group – Event configuration – Event ID mode** 
+ **Output group – Event configuration – Event ID**
+ **Microsoft Smooth settings** section – **General configuration** section:
  + **Connection retry interval** 
  + **Num retries**
  + **Filecache duration**
  + **Restart delay**
  + **Certificate mode**

## Complete the fields on the console
<a name="smooth-specify-destination"></a>

The full path for each output in a Microsoft Smooth output group consists of the following:

`URL eventID streamInformation `
+ The URL and event ID are know as the *publishing points*. For example:

  `https://203.0.113.18/sports/Events(1585232182)`
+ MediaLive generates the event ID using information that you provide. For more information, expand **Event Configuration** on the console, and choose the **Info **link next to each field.
+ MediaLive generates the stream ID. It assigns a unique number to the stream, starting from 0. For example: `/Streams(stream0)`.

  You will be able to see the stream information when you look at the MediaLive logs for the output.

**To specify the path and connection to the downstream system**

1. Complete the **URL** fields in the **Microsoft Smooth group destinations** section. Specify two destinations if the channel is set up as a standard channel, or one destination if it is set up as a single-pipeline channel. Don't worry about the event ID. You will specify that in another field.

    For example:

   `https://203.0.113.55/sports/curling`

   `https://203.0.113.82/sports/curling`

1. Complete the **Credentials** section, if the downstream system provided you with a user name and password. For the password, enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md). 

1. If you obtained values to configure the connection, enter those values in the **General configuration** section on the **Microsoft Smooth group** page.

1. Set up the event ID in the following fields: 

   **Output group settings – Event configuration – Event ID Mode**

   **Output group settings – Event configuration – Event ID**

   You can set up the event ID in three ways:
   + With an event ID that you specify – Set **Event ID mode** to **USE\$1CONFIGURED**. Then specify the ID. For example, **curling**. The event ID will look like this: **/Events(curling)**
   + With a timestamp – Set **Event ID mode** to **USE\$1TIMESTAMP**. MediaLive generates a Unix timecode based on the time that you start the channel. The event ID will look like this: **/Events(1585232182)**
   + With no event ID – set **Event ID mode** to **NO\$1EVENT\$1ID**. We strongly recommend that you don't use this method.

# Fields for the container
<a name="smooth-container"></a>

The following fields configure the container in each output.
+ **Microsoft Smooth settings** section – **General configuration** section – **Fragment length** 
+ **Event configuration** – **Stream manifest behavior**
+ **Event configuration – Event stop behavior**

These fields let you configure some of the streaming behavior. For information about a field, choose the **Info** link in the MediaLive console. 

# Fields for the encodes
<a name="smooth-streams-section"></a>

The following fields relate to the encoding of the video, audio, and captions streams (encodes) in the output. 
+ **Stream settings** section

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

# Fields for other Microsoft Smooth features
<a name="mss-other-fields"></a>

## Fields for resiliency
<a name="smooth-resiliency"></a>

The following field relates to implementing resiliency in a Microsoft Smooth output. 
+ **Microsoft Smooth output group** – **Microsoft Smooth Settings** section – **General configuration** section – **Input loss action**

Optionally change the value of **Input loss action**. 

Choose the **Info** link in the MediaLive console to decide which option to choose. For more information, see [Handling loss of video input](feature-input-loss.md).

## Fields for timecode
<a name="smooth-timecode"></a>

The following fields relate to configuring the timecode and timestamp in all the outputs in the output group. 
+ **Microsoft Smooth output group** – **Timecode Configuration** section 

For details about a field, choose the **Info** link next to the field in the MediaLive console.

## Fields for SCTE-35
<a name="smooth-s35"></a>

The following fields relate to configuring the timecode and timestamp in all the outputs in the output group. 
+ **Microsoft Smooth output group** – **Timecode Configuration** section 

If you want all the outputs in this output group to include the SCTE-35 messages that are already present in the input, choose **Sparse track**. The messages will be included in a sparse track. For more information, see [Processing SCTE 35 messages](scte-35-message-processing.md) and specifically [Enabling decoration – Microsoft Smooth](procedure-to-enable-decoration-ms-smooth.md).

# Creating an RTMP output group
<a name="opg-rtmp"></a>

When you create a AWS Elemental MediaLive channel, you might want to include an RTMP output group. For information about the use cases for an RTMP output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

**Topics**
+ [Organize encodes in an RTMP output group](design-rtmp-package.md)
+ [Coordinate with the downstream system](origin-server-rtmp.md)
+ [Create an RTMP output group](creating-rtmp-output-group.md)

# Organize encodes in an RTMP output group
<a name="design-rtmp-package"></a>

An RTMP output group can contain the following:
+ One or more outputs.

Each output can contain the following:
+ One video encode.
+ Zero or one audio encodes.
+ Zero or one captions encodes.

This diagram illustrates an RTMP output group that contains one output where the captions are embedded in the video encode.

![\[Diagram showing Output Group containing Output with Video and Captions embedded.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output1-non-abr-Ve-A.png)


This diagram illustrates an RTMP output group that contains one output with object-style captions. 

![\[Venn diagram showing three overlapping circles labeled V, A, and C.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output2-non-abr-VAC.png)


# Coordinate with the downstream system
<a name="origin-server-rtmp"></a>

You and the operator of the downstream system must agree about the destination for each output of the RTMP output group. 

An RTMP output group requires one set of destination addresses for each output. 

1. If the RTMP server is a social media site, the host of the site might have instructions that can supplement the following information. Obtain these instructions.

1. Decide if you need two destinations for the output: 
   + If the MediaLive channel is a [standard channel](plan-redundancy.md), you need two destinations.
   + If the MediaLive channel is a single-pipeline channel, you need one destination. 

1. Make sure that the RTMP operator sets up to expect MediaLive output at one or two inputs on the RTMP server, as appropriate.

1. Obtain the following information from the RTMP operator:
   + The protocol for MediaLive to use—RTMP or RTMPS.
   + The user name and password to access the downstream system, if the downstream system requires authenticated requests. Note that these user credentials relate to user authentication, not to the protocol. User authentication is about whether the downstream system will accept your request. The protocol is about whether the request is sent over a secure connection.
   + IP address.
   + Port number.
   + Application name. Also called *app name*.
   + Stream name. Also called *application instance* or *app instance* or *stream key*.

     The operator might give you the application name and stream name as separate pieces of data. Or they might give you a complete path in the format **string/string**. In this case, the first string is the application name and the second string is the stream name.

   Here is an example of the information that the operator will give you:

   `rtmp://203.0.113.28:80/xyz/ywq7b`

   `rtmp://203.0.113.17:80/xyz/ywq7b`

   Where `xyz` is the application name, and `ywq7b` is the stream name.

   In this example, the two URLs have different IP addresses but the same application name/stream name portion. Your RTMP server might follow a different rule. 

# Create an RTMP output group
<a name="creating-rtmp-output-group"></a>

When you [planned the workflow for your channel](identify-downstream-system.md), you might have determined that you want to include an RTMP output group.

1. On the **Create channel** page, under **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **RTMP**, and then choose **Confirm**. More sections appear: 
   + **RTMP settings** – This section contains fields for the [connection configuration](rtmp-connection.md), for [resiliency](rtmp-other.md), and for [captions](rtmp-other.md). 
   + **RTMP outputs** – This section shows the single output that is added by default. An RTMP output can contain only one output, so don't click **Add output**. 

1. In **RTMP outputs**, choose the **Settings** link to view the sections for the output:
   + **RTMP destination** – This section contains fields for the [output destination](rtmp-destinations.md). 
   + **Output settings** – This section contains fields for the [connection configuration](rtmp-connection.md). 
   + **Stream settings** – This section contains fields for the [output streams](rtmp-streams.md) (the video, audio, and captions).

1. (Optional) Enter names for the output group and the output:
   + In **RTMP settings**, for **Name**, enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Game**.
   + In **RTMP output**, in **Output settings**, for **Output name**, enter a name for the output. This name is internal to MediaLive; it doesn't appear in the output.

1. To complete the other fields, see the topics listed after this procedure.

1. After you have finished setting up this output group and its single output, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md).

**Topics**
+ [Fields for the output destination](rtmp-destinations.md)
+ [Fields for the RTMP connection](rtmp-connection.md)
+ [Fields for the video, Audio, and captions streams (encodes)](rtmp-streams.md)
+ [Other fields](rtmp-other.md)

# Fields for the output destination
<a name="rtmp-destinations"></a>

The following fields configure the location and names of the RTMP output files (the destination).
+ **Output** – **RTMP destination** sections

**To specify the destination for the output**

1. When you [discussed your requirements](origin-server-rtmp.md) with the operator of the RTMP server, you should have obtained the following information:
   + The protocol for MediaLive to use—RTMP or RTMPS.
   + IP address.
   + Port number.
   + Application name. Also called *app name*.
   + Stream name. Also called *application instance* or *app instance* or *stream key*.

     The operator might give you the application name and stream name as separate pieces of data. Or they might give you a complete path in the format **string/string**. In this case, the first string is the application name and the second string is the stream name.
   + The user name and password to access the server, if the downstream system requires authenticated requests. 

   Here is an example of the information that the operator will give you:

   `rtmp://203.0.113.17:80/xyz/ywq7b`

   Where `xyz` is the application name, and `ywq7b` is the stream name.

1. Enter the different portions of the destination in the appropriate fields.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/rtmp-destinations.html)

1. Complete the **Credentials** section, if the server the downstream system provided you with a user name and password. For the password, enter the name of the password stored on the AWS Systems Manager Parameter Store. Don't enter the password itself. For more information, see [Requirements for AWS Systems Manager password parameters](requirements-for-EC2.md). 

# Fields for the RTMP connection
<a name="rtmp-connection"></a>

The following fields configure the logic for reconnection attempts:
+ **RTMP settings** – **Authentication scheme**
+ **RTMP settings** – **Additional settings** – **Cache length**
+ **RTMP settings** – **Additional settings** – **Restart delay**
+ **RTMP settings** – **Additional settings** – **Cache full behavior**
+ **RTMP outputs** – **Output settings** – **Connection retry interval**
+ **RTMP outputs** – **Output settings** – **Num retries**
+ **RTMP outputs** – **Output settings** – **Additional settings** – **Certificate mode**

**To configure a secure (RTMPS) connection to the destination**

1. **Authentication Scheme** – Specify the type of scheme. Typically, choose **Common**. Choose **Akamai** only if instructed to do so by the downstream system. 

1. For **Certificate mode**, choose the option that is required by the downstream system. 

   If you connect over RTMP, MediaLive ignores both these fields.

**To configure for reconnection**

There are several fields that control how MediaLive behaves if the connection to the RTMP server seems to drop:
+ **Cache length** specifies how long to hold the output in memory, waiting for the RTMP server to respond.
+ When that time expires, **Cache full behavior** specifies whether to disconnect immediately or wait 5 minutes.
+ If MediaLive disconnects, then **Restart delay** specifies how long to wait before trying to reconnect.
+ When MediaLive tries to reconnect, **Connection retry interval** specifies how often to retry. **Num retries** specifies how many times to retry. When the retries expire, this output stops. The channel stops because the single output has lost its connection.

# Fields for the video, Audio, and captions streams (encodes)
<a name="rtmp-streams"></a>

The following fields relate to the encoding of the video, audio, and captions streams (encodes) in the output. 
+ **Stream settings** section

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

# Other fields
<a name="rtmp-other"></a>

The following field relates to implementing resiliency in an RTMP output:
+ **RTMP settings** – **Input loss action** – For details about a field on the MediaLive console, choose the **Info** link next to the field. For more information, see [Handling loss of video input](feature-input-loss.md).

The following field relates to implementing captions in an RTMP output:
+ **RTMP settings** – **Caption data** – Complete this field only if at least one of your outputs includes captions with **embedded** as the source captions format and **RTMP CaptionInfo** as the output format. If there are no captions in any output, the value in this field is ignored.

  For detailed information about setting up for captions, see [Including captions in a channel](captions.md).

# Creating an SRT output group
<a name="opg-srt"></a>

When you create a AWS Elemental MediaLive channel, you might want to include an SRT output group. For information about the use cases for an SRT output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

With an SRT output group, you can create one or more outputs. Each output is an SPTS with its own destination.

SRT outputs support two connection modes:
+ **Caller mode**: MediaLive initiates connections to downstream systems. MediaLive is the caller and sender. The downstream system is the listener and receiver. MediaLive initiates the handshake with the downstream system, and after the handshake is accepted, MediaLive sends the content to the downstream system.
+ **Listener mode**: Downstream systems initiate connections to MediaLive. MediaLive is the listener and sender. The downstream system is the caller and receiver. The downstream system initiates the handshake with MediaLive, and after the handshake is accepted, MediaLive sends the content to the downstream system.

The output content must be encrypted, so you must use AWS Secrets Manager to store a passphrase that MediaLive will use to encrypt the content.

This section includes specific guidelines if you are sending the SRT output to an AWS Elemental MediaConnect flow.

**Topics**
+ [Selecting the SRT connection mode](srt-connection-mode-selection.md)
+ [Organize encodes in an SRT output group](design-srt-package.md)
+ [Plan for delivery using Amazon VPC](srt-get-ready.md)
+ [Set up the passphrase in AWS Secrets Manager](srt-output-encryption-asm.md)
+ [Creating SRT outputs in caller mode](creating-srt-caller-output.md)
+ [Creating SRT outputs in listener mode](creating-srt-listener-output.md)
+ [Output > Stream settings](srt-streams.md)

# Selecting the SRT connection mode
<a name="srt-connection-mode-selection"></a>

When you create an SRT output group, you must choose the connection mode for each output. The connection mode determines how MediaLive and the downstream system establish the SRT connection.

The following table compares the two connection modes:


| Characteristic | Caller mode | Listener mode | 
| --- | --- | --- | 
| Connection initiation | MediaLive initiates connections to downstream systems | Downstream systems initiate connections to MediaLive | 
| MediaLive role | Caller and sender | Listener and sender | 
| Downstream role | Listener and receiver | Caller and receiver | 
| Destination configuration | You specify the downstream system's IP address and port | MediaLive allocates IP addresses; you specify the port | 
| Channel security group | Not required | Required for channels using Public delivery method (controls which downstream systems can connect). Not required for VPC delivery or MediaLive Anywhere channels; customers must configure their network to allow SRT connections from the caller destination. | 
| Use case | Push-style delivery where MediaLive connects to known downstream endpoints | Pull-style delivery where downstream systems connect to MediaLive on demand | 
| MediaLive Anywhere support | Supported | Supported | 

**Note**  
You cannot mix connection modes within a single output. Each output must use either caller mode or listener mode for all its destinations.

# Organize encodes in an SRT output group
<a name="design-srt-package"></a>

An SRT output group can contain the following:
+ One or more outputs.

Each output contains the following:
+ One video encode.
+ One or more audio encodes.
+ Zero or more captions encodes. The captions are either embedded or object-style captions. 

Each output represents one SPTS. Each output (SPTS) has its own destination.

This diagram illustrates an SRT output group with one output. The captions are embedded in the video encode.

![\[alt text not found\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output3-nonABR-Ve-2A.png)


This diagram illustrates an SRT output group with one output. The captions are object-style captions.

![\[alt text not found\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output4-nonABR-V-2A-2C.png)


# Plan for delivery using Amazon VPC
<a name="srt-get-ready"></a>

You might set up the MediaLive channel for the SRT output to have [output endpoints in Amazon Virtual Private Cloud](delivery-out-vpc.md) (Amazon VPC). Following are some guidelines for setting up the secret in Secrets Manager and for delivery of the output to MediaConnect (if MediaConnect is the destination).

## Considerations for Secrets Manager
<a name="srt-get-ready-asm"></a>

SRT outputs are always encrypted, therefore AWS Secrets Manager is always involved. There are specific requirements for the VPC subnet where you will create the channel:
+ The subnet for the channel must have a Secrets Manager endpoint.
+ The subnet for the channel and the Secrets Manager endpoint must use the same security group, which means that the same security group must be associated with the subnet and with the endpoint.

## Considerations for MediaConnect
<a name="srt-get-ready-emx"></a>

You might be delivering to a MediaConnect that also uses a VPC. This means that the SRT output egress from the MediaLive channel is on your VPC and that the MediaConnect flow has a VPC interface.
+ The administrator for your VPC must ensure that there is an appropriate route between MediaLive and MediaConnect. 

# Set up the passphrase in AWS Secrets Manager
<a name="srt-output-encryption-asm"></a>

You must set up for the mandatory encryption of the SRT output. Follow these steps:

1. You and the operator of the downstream system should have already agreed about an encryption passphrase.

1. Give the passphrase to a person in your organization who works with AWS Secrets Manager. That person must store the passphrase in a secret in Secrets Manager. For more information, see [Create an AWS Secrets Manager secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_secret.html). Create a secret of type **Other type of secret**. 

   Secrets Manager generates an ARN that looks like this:

   `arn:aws:secretsmanager:region:123456789012:secret:Sample-abcdef`
**Important**  
Store SRT passphrases in Secrets Manager as plaintext (for example, `secretpassword123`). Do not use the key/value option or JSON format when creating the Secret, as this may cause interoperability issues with other services. Store the passphrase as plaintext only.  
Ensure your passphrase is between 10 and 79 characters.

1. Make sure that you obtain the full ARN of the secret to use for your SRT output's encryption passphrase Secret ARN.

# Creating SRT outputs in caller mode
<a name="creating-srt-caller-output"></a>

This section describes how to create SRT outputs in caller mode, where MediaLive initiates connections to downstream systems.

**Topics**
+ [Coordinate with the downstream system](downstream-system-srt-caller.md)
+ [Create the SRT output in caller mode](creating-srt-caller-output-group.md)
+ [Provide information to the downstream system](srt-caller-info-to-downstream.md)

# Coordinate with the downstream system
<a name="downstream-system-srt-caller"></a>

With an SRT output group, you can create more than one output, in order to deliver the same content to more than one downstream system.

You and the operator of each downstream system must discuss details about the output delivery. With caller mode, MediaLive is the caller and the sender. The downstream system is the listener and the receiver.

1. Decide if you need two destinations for the output: 
   + If the MediaLive channel is a [standard channel](plan-redundancy.md), you need two destinations. 
   + If the MediaLive channel is a single-pipeline channel, you need one destination. 

1. Obtain the IP address and port for each destination. For example, `srt://203.0.113.22:5000` and `srt://203.0.113.88:5001`. 

   Note that if you are delivering to MediaConnect, you can obtain the addresses only after the MediaConnect operator creates the flows. See the last step in this procedure.

1. MediaLive always encrypts the content, therefore you must agree about the following encryption details:
   + The encryption algorithm: AES 128, AES 192, or AES 256.
   + The passphrase that MediaLive and the downstream system will use to create the encryption and decryption keys. The passphrase can be 10 to 79 Unicode characters, which means that spaces are allowed. 

1. Discuss the following with the operator of the downstream system:
   + Tell the downstream system about the latency (in milliseconds) that you plan to configure into MediaLive for packet loss and recovery. Packet recovery is a key feature of SRT. The downstream destination should choose a latency value that is close to the value that you plan to use.

     You will configure the latency in each output, so each downstream system can have a different latency. 
   + MediaLive works without a stream ID. But if you want to include one, or if the downstream system would like to use one, agree on the ID. Maximum 512 UTF-8 characters.

1. If you are delivering to a MediaConnect flow, ask the MediaConnect operator to create their flow now.

   Ask the operator to give you the one or two addresses that are in the Inbound IP address field for that flow. These addresses are the destinations for the SRT output. For example, `srt://203.0.113.22:5000` and `srt://203.0.113.88:5001`.

# Create the SRT output in caller mode
<a name="creating-srt-caller-output-group"></a>

After you have designed the contents of the output and you have coordinated delivery of the output with the downstream system, you can create the SRT output in caller mode.

1. On the **Create channel** page, under **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **SRT**, and then choose **Confirm**. More sections appear.

   The form for this output group is broken down into the following sections:
   + **SRT settings**: Features that apply at the output group level, not in individual outputs.
   + **SRT outputs**: Outputs in the output group.
   + **Output > Destinations**: The URL and encryption fields for each output. 
   + **Output > Output settings**: Networking and transport stream settings, and configure individual PIDs.
   + **Output > Stream settings**: Configuration of the video, audio, and captions in each output.

   For information about each section, see the topics listed after this procedure.

1.  After you have finished setting up this output group and its outputs, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md)

## SRT settings
<a name="srt-caller-srt-settings"></a>

In the **SRT settings** sections, complete the fields:
+ **Name**: Enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Game**.
+ **Input loss action**: Choose a value. For details, choose the **Info** link. For detailed information about input loss handling for all output groups in the channel, see [Handling loss of video input](feature-input-loss.md).

## SRT outputs
<a name="srt-caller-srt-outputs"></a>

The **SRT outputs** section shows the single output that is added by default. Choose **Add output** if you want to send the content to more destinations.

In each output, choose the **Settings** link to show three subsections:
+ Destinations. See [Output > Destinations](#srt-caller-destinations).
+ Output settings. See [Output > Output settings](#srt-caller-output-settings)
+ Stream settings: See [Output > Stream settings](srt-streams.md).

## Output > Destinations
<a name="srt-caller-destinations"></a>

In each output, you must specify one destination (for a single-pipeline channel) or two destinations (for a standard channel). You must also configure encryption for each destination. 
+ **Connection mode**: Select **Caller**.
+ Enter the destination URL or URLs, including the port number. You obtained this information when you [discussed your requirements](downstream-system-srt-caller.md) with the downstream system. For example:

  **srt://203.0.113.22:5000**

  **srt://203.0.113.88:5001**
+ Stream ID: Optional.
+ In each destination, select the secret that [you obtained from the operator of Secrets Manager](srt-output-encryption-asm.md). You can select the secret by its ARN or its name.

## Output > Output settings
<a name="srt-caller-output-settings"></a>

Enter a user-friendly name for the output, or leave the default. This name is internal to MediaLive and doesn't appear in the output.

The remainder of this section contains fields that let you configure the following:
+ Network behavior.
+ Characteristics of the transport stream (in the **Container** section).
+ PID values (in the **PID Settings** section). 

  These fields cover the SI/PSI and other data. For each of the SI/PSI PIDs, you can specify a custom value or you can let MediaLive use the default value. 

  For other data, complete the fields as appropriate. With some of these fields, the behavior is different for fields that you leave empty. MediaLive might omit the data from the transport stream. Or MediaLive might use default values.

Change any values as appropriate. For details about a field, choose the **Info** link next to the field in the MediaLive console.

# Provide information to the downstream system
<a name="srt-caller-info-to-downstream"></a>

The downstream system might need the source IP addresses of the one or two MediaLive streams, so that they can allow these addresses to connect to them. If the downstream system is MediaConnect, it definitely needs this information.

**On an AWS Cloud channel**

Read this information if your organization doesn't deploy MediaLive Anywhere.
+ After you have created the channel, select the channel by its name. The channel details appear.

  In the **Destinations** tab, find the **Egress endpoints** section. Copy the one or two IP addresses. There is one set of addresses for the channel, not one set for each output. 
+ Make a note of the IP addresses and label them correctly as pipeline 0 and pipeline 1. Give them to the downstream operator. 

**On a MediaLive Anywhere channel**

Read this information if your channel is a MediaLive Anywhere channel, which means that it is running on an on-premises hardware, not in the AWS Cloud.
+ Obtain the IP address of the Gateway into the network. You might need to speak to the network administrator in your organization. Give this address to the downstream operator.

# Creating SRT outputs in listener mode
<a name="creating-srt-listener-output"></a>

This section describes how to create SRT outputs in listener mode, where downstream systems initiate connections to MediaLive.

**Topics**
+ [Prerequisites for listener mode](srt-listener-prerequisites.md)
+ [Create the SRT output in listener mode](creating-srt-listener-output-group.md)
+ [Additional setup for MediaLive Anywhere channels](srt-listener-emla-setup.md)
+ [Provide connection information to downstream systems](srt-listener-provide-info.md)
+ [Validation rules for listener mode](srt-listener-validation.md)

# Prerequisites for listener mode
<a name="srt-listener-prerequisites"></a>

Before you create SRT outputs in listener mode, you must complete the following prerequisites:

1. **Create or identify a channel security group (Public delivery method only)**: For channels using the Public delivery method, you must attach a channel security group to the channel. The channel security group controls which downstream systems (SRT callers) are allowed to connect to the MediaLive listener endpoints. For information about channel security groups, see [Using channel security groups](feature-channel-security-groups.md).

   For channels using VPC delivery or MediaLive Anywhere channels, the channel security group is not required. Instead, you must configure your network to allow SRT connections from the caller destination to reach the listener endpoints.

1. **Coordinate with downstream systems**: Discuss the following with the operator of each downstream system:
   + The IP addresses that the downstream systems will connect from. You need these addresses to create or update the input security group that the channel security group references.
   + The encryption algorithm: AES 128, AES 192, or AES 256.
   + The passphrase for encryption. The passphrase can be 10 to 79 Unicode characters.
   + The preferred latency (in milliseconds) for packet loss and recovery. The valid range is 120 to 15000 milliseconds.
   + The stream ID, if the downstream system uses this identifier. The stream ID is optional.

1. **Store the passphrase in Secrets Manager**: Follow the steps in [Set up the passphrase in AWS Secrets Manager](srt-output-encryption-asm.md) to store the passphrase in AWS Secrets Manager.

# Create the SRT output in listener mode
<a name="creating-srt-listener-output-group"></a>

After you have completed the prerequisites and coordinated with the downstream systems, you can create the SRT output in listener mode.

1. On the **Create channel** page, choose **Channel and input details** in the navigation pane.

1. **For channels using Public delivery method only**: In the **General settings** section, find the **Channel security groups** field.

1. **For channels using Public delivery method only**: From the dropdown list, select the input security group that you want to use as the channel security group.

1. Navigate to the **Output groups** section and choose **Add**.

1. In the **Add output group** section, choose **SRT**, and then choose **Confirm**.

1. In the **SRT settings** section, complete the fields:
   + **Name**: Enter a name for the output group.
   + **Input loss action**: Choose a value. For details, see [Handling loss of video input](feature-input-loss.md).

1. In the **SRT outputs** section, choose the **Settings** link for the output.

1. In the **Destinations** section, configure the listener mode settings:
   + **Connection mode**: Select **LISTENER**.
   + **Listener port**: Enter the port number that MediaLive will listen on. The valid range is 5000 to 5200.

     You must have unique ports for each of the SRT listener outputs on your channel.

     For a standard channel with two pipelines, you must have unique listener ports for each pipeline destination as well.
   + **Stream ID**: Optional. Enter the stream ID if you agreed on one with the downstream systems.
   + **Encryption passphrase secret ARN**: Select the ARN of the secret you created in Secrets Manager.

1. Complete the **Output settings** and **Stream settings** sections as described in [Output > Output settings](creating-srt-caller-output-group.md#srt-caller-output-settings) and [Output > Stream settings](srt-streams.md).

1. After you have finished setting up this output group and its outputs, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md).

# Additional setup for MediaLive Anywhere channels
<a name="srt-listener-emla-setup"></a>

If you are creating an SRT listener output on a MediaLive Anywhere channel, there are additional configuration requirements:
+ **Logical interface name**: In the **Destinations** section, you must specify the logical interface for each output in listener mode. This field appears when you create a channel on a MediaLive Anywhere cluster. The logical interface determines which physical network interface on the MediaLive Anywhere node will be used for the SRT listener.
+ **Node interface IPs**: After you create the channel, the destination information will include the node interface IPs. This field displays the IP address that the downstream system should use to connect to the MediaLive Anywhere node. The IP address is associated with the physical interface that is mapped to the logical interface you selected.
  + **In the console**: The node interface IPs are displayed in the **Destinations** table under the **SRT destination settings** section.
  + **Using the API**: The node interface IPs are included in the node describe call as `PhysicalInterfaceIpAddresses`.

  You must provide this IP address to the downstream systems so they can configure their SRT callers to connect to the correct MediaLive Anywhere node interface.

# Provide connection information to downstream systems
<a name="srt-listener-provide-info"></a>

After you create the channel with SRT outputs in listener mode, you must provide connection information to the operators of the downstream systems so they can configure their SRT callers to connect to MediaLive.

**To obtain the connection information**

1. After you have created the channel, select the channel by its name. The channel details appear.

1. Choose the **Destinations** tab.

1. In the **Output destinations** section, find the SRT output group.

1. For each output in the group, note the connection information that downstream systems will need. For a standard channel, there are two sets of information (one for each pipeline). For a single-pipeline channel, there is one set.

   **For MediaLive channels**:
   + In the **Egress endpoints** section under the **Destinations** tab, note the **Source IP** address. This is the IP address that downstream systems should connect to.
   + In the **SRT destination settings** section, note the **Listener port**.
   + Provide the destination to downstream operators in the format `srt://source-ip:listener-port`.

   **For MediaLive Anywhere channels**:
   + In the **SRT destination settings** section under the **Destinations** tab, note the **Node interface IPs**. This is the IP address that downstream systems should connect to.
   + In the same section, note the **Listener port**.
   + Provide the destination to downstream operators in the format `srt://node-interface-ip:listener-port`.

1. Provide these destination URLs to the operators of the downstream systems. The operators must configure their SRT callers to connect to these addresses.

Make sure that the operators at the downstream systems set up as follows:
+ They configure the correct number of connections:
  + If the MediaLive channel is a standard channel, they must connect to both destination addresses for redundancy.
  + If the MediaLive channel is a single-pipeline channel, they must connect to the single destination address.
+ They configure their SRT callers to use the same encryption algorithm and passphrase that you agreed on.
+ They configure their SRT callers to use a latency value. SRT will negotiate and use the maximum of the latency values configured on both sides.
+ If you specified a stream ID in the output configuration, the downstream systems can optionally send a stream ID value during connection. MediaLive accepts connections with any stream ID value (or no stream ID). The stream ID is logged for monitoring and troubleshooting purposes only.
+ Their source IP addresses must be included in the CIDR allow list of the input security group that the channel security group references. Otherwise, MediaLive will reject their connection attempts.

# Validation rules for listener mode
<a name="srt-listener-validation"></a>

MediaLive enforces the following validation rules when you create or update SRT outputs in listener mode:
+ **Channel security group required (Public delivery method only)**: For channels using the Public delivery method, if the channel includes at least one SRT output configured in listener mode, you must attach a channel security group to the channel. If you attempt to create or start a channel using Public delivery with SRT outputs in listener mode but no channel security group, MediaLive returns an error. For channels using VPC delivery or MediaLive Anywhere channels, the channel security group is not required; you must configure your network to allow SRT connections from the caller destination.
+ **Port uniqueness**: Within a single channel, each SRT output in listener mode must use a unique port number. If you attempt to create two outputs with the same port, MediaLive returns an error.
+ **Listener port range**: The port number must be in the range 5000 to 5200 inclusive. 
+ **Cannot remove channel security group**: If the channel has SRT outputs in listener mode, you cannot remove the channel security group. You must first remove all SRT outputs configured in listener mode, or change them to caller mode.
+ **Cannot change mode on running channel**: You cannot change an output's connection mode (from caller to listener or vice versa) while the channel is running. You must stop the channel first.

# Output > Stream settings
<a name="srt-streams"></a>

The fields in this section relate to the encoding of the video, audio, and captions streams (encodes) in the output. These settings apply to both caller mode and listener mode outputs.

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+ [Set up the captions encodes](creating-a-channel-step8.md)

# Creating a UDP output group
<a name="opg-udp"></a>

When you create a AWS Elemental MediaLive channel, you might want to include a UDP output group. For information about the use cases for a UDP output group, see [Containers, protocols, and downstream systems](outputs-supported-containers-downstream-systems.md).

**Topics**
+ [Organize encodes in a UDP output group](design-udp-package.md)
+ [Coordinate with the downstream system](downstream-system-udp.md)
+ [Creating a UDP output group](creating-udp-output-group.md)

# Organize encodes in a UDP output group
<a name="design-udp-package"></a>

A UDP output group can contain the following:
+ One or more outputs.

Each output can contain the following:
+ One video encode.
+ One or more audio encodes.
+ One or more captions encodes. The captions are either embedded or object-style captions. 

Each output represents one SPTS. Each output (SPTS) has its own destination..

This diagram illustrates a UDP output group with one output. The captions are embedded in the video encode.

![\[Output group diagram showing video encode with embedded captions and two audio outputs.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output3-nonABR-Ve-2A.png)


This diagram illustrates a UDP output group with one output. The captions are object-style captions.

![\[Output group diagram showing V, A, A, C, C as individual elements in sequence.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/output4-nonABR-V-2A-2C.png)


# Coordinate with the downstream system
<a name="downstream-system-udp"></a>

You and the operator of the downstream system must agree about the destination for each output of the UDP output group.

A UDP output group requires one set of destination addresses for each output. 

1. Decide if you need two destinations for the output: 
   + If the MediaLive channel is a [standard channel](plan-redundancy.md), you need two destinations.
   + If the MediaLive channel is a single-pipeline channel, you need one destination. 

1. Speak to the operator who manages the downstream system that will receive UDP content. Make sure that the operator sets up to expect one or two MediaLive outputs, as appropriate. 

1. Obtain the following information from the operator:
   + Whether the protocol is UDP or RTP
   + The URLs
   + The port numbers

   Each URL will look like this, for example:

   `udp://203.0.113.28:5000`

   `udp://203.0.113.33:5005`

   Note that in this example, the port numbers are not sequential. These non-sequential numbers are important if you plan to enable FEC in the outputs (this field is in the **Output** pane of the UDP output group). With FEC, you must leave space between the port numbers for the two destinations. For example, if one destination is **rtp://203.0.113.28:5000**, assume that FEC also uses port 5002 and 5004. So the lowest possible port number for the other destination is 5005.

# Creating a UDP output group
<a name="creating-udp-output-group"></a>

When you [planned the workflow for your channel](identify-downstream-system.md), you might have determined that you want to include a UDP output group.

1. On the **Create channel** page, under **Output groups**, choose **Add**. 

1. In the **Add output group** section, choose **UDP**, and then choose **Confirm**. More sections appear: 
   + **UDP destination** – This section contains fields for the [output destination](udp-destinations.md).
   + **UDP settings** – This section contains fields for [setting up ID3](udp-other.md) and for [resiliency](udp-other.md). 
   + **UDP outputs** – This section shows the single output that is added by default. A UDP output can contain only one output, so don't click **Add output**. 

1. In **UDP outputs**, choose the **Settings** link to view the sections for the output:
   + **Output settings** – This section contains fields for the [transport](udp-destinations.md) and the [connection to the destination](udp-destinations.md). 
   + **Stream settings** – This section contains fields for the [output streams](udp-streams.md) (the video, audio, and captions).

1. (Optional) Enter names for the output group and the output:
   + In **UDP settings**, for **Name**, enter a name for the output group. This name is internal to MediaLive; it doesn't appear in the output. For example, **Sports Game**.
   + In **UDP output**, in **Output settings**, for **Output name**, enter a name for the output. This name is internal to MediaLive; it doesn't appear in the output.

1. To complete the other fields, see the topics listed after this procedure.

1. After you have finished setting up this output group and its single output, you can create another output group (of any type), if your plan requires it. Otherwise, go to [Save the channel](creating-a-channel-step9.md).

**Topics**
+ [Fields for the output destination](udp-destinations.md)
+ [Fields for the UDP transport](udp-container.md)
+ [Fields for the video, audio, and captions stream (encode)](udp-streams.md)
+ [Fields for other UDP features](udp-other.md)

# Fields for the output destination
<a name="udp-destinations"></a>

The following fields configure the destination of the output:
+ **Output group** – **UDP destination** sections
+ **Output** – **Output settings** – **Network settings** – **Buffer msec**

**To specify the destination for the output**

1. When you [discussed your requirements](origin-server-rtmp.md) with the operator who manages the downstream system that will receive UDP content, you should have obtained the following information:
   + The URLs
   + The port numbers

   For example:

   `udp://203.0.113.28:5000`

   `udp://203.0.113.33:5005`

1. Enter the URLs, including the port number, in one or both of the **URL** fields in the **UDP destinations** section. 

1. If you [enable FEC](udp-container.md), leave space between the port numbers for the two destinations. 

   For example, if one destination is **rtp://203.0.113.28:5000**, assume that FEC also uses port 5002 and 5004. So the lowest possible port number for the other destination is 5005: **rtp://203.0.113.33:5005**.

1. (Optional) In the **Output** section, complete the **Buffer msec** field as appropriate. For details, choose the **Info** link next to the field in the MediaLive console.

# Fields for the UDP transport
<a name="udp-container"></a>

The following fields configure the transport in each output:
+ **Output** – **Output settings** – **FEC output settings**, choose a value. 
+ **Output** – **Output settings** – **Network settings** – **Container settings** section.

Change any values as appropriate. For details about a field, choose the **Info** link next to the field in the MediaLive console.

# Fields for the video, audio, and captions stream (encode)
<a name="udp-streams"></a>

The following fields relate to the encoding of the video, audio, and captions streams (encodes) in the output. 
+ **Stream settings** section

For information about creating encodes, see the following sections:
+ [Set up the video encode](creating-a-channel-step6.md)
+ [Set up the audio encodes](creating-a-channel-step7.md)
+  [Set up the captions encodes](creating-a-channel-step8.md)

# Fields for other UDP features
<a name="udp-other"></a>

The following field relates to implementing resiliency in a UDP output:
+ **UDP settings** – **Input loss action** – For details about a field on the MediaLive console, choose the **Info** link next to the field. For more information, see [Handling loss of video input](feature-input-loss.md).

The following fields relate to implementing captions in a UDP output:
+ **UDP settings** –** Timed metadata ID3 frame type**
+ **UDP settings** –** Timed metadata ID3 period**

  Complete these fields if you want to insert timed ID3 metadata into all the outputs in this output group. For detailed instructions, see [Working with ID3 metadata](id3-metadata.md)and specifically [Inserting ID3 timed metadata when creating the MediaLive channel](insert-timed-metadata.md).