

# Creating an output with an audio rendition group
<a name="ARG-create"></a>

This section describes how to create audio rendition groups in an HLS output group and how to associate those groups with the appropriate video outputs (if any). The encodes and associations that you create are the following:
+ If you want to include video in the output group, then for each video asset, you create one video output containing one video encode. The output can also contain embedded captions, but it can't include sidecar captions. The output can't contain audio encodes.
+ For each audio asset, you create one *audio-only* output containing one audio encode and no other encodes. 
+ You decide on an ID for each rendition group. The ID is a name that you decide on. For example *AAC audio group*.
+ To group several audio outputs into one rendition group, you assign the same *audio group ID * to each audio output. 
+ Finally, to associate the video output (if any) with the audio rendition group, you assign the *audio group ID *to that video output. 

**Topics**
+ [Identify the video and audio encodes](ARG-step-create-mapping.md)
+ [Determine Defaults and Selection Rules](ARG-step-defaults.md)
+ [Create the video outputs](ARG-step-create-video.md)
+ [Create the audio outputs](ARG-step-create-audio.md)
+ [Summary](ARG-create-summary.md)

# Identify the video and audio encodes
<a name="ARG-step-create-mapping"></a>

You must plan the requirements for the audio rendition group. You must identify the video encodes that you want in the output group. You then decide on the individual audio encodes. Finally, you identify the audio rendition groups you want each encode to belong to.

**To identify and map the encodes**

1. Identify any video encodes that you require in the HLS output group. For example, one high-resolution encode and one low-resolution encode.

1. Identify the audio encodes that you require. For example, AAC in English and French, and Dolby Digital in English and French.

1. Decide how many audio renditions you require. Review the [rules](#ARG-rules) to ensure that you design a rendition group that is valid. 

1. Give a name to each video, audio, and audio rendition group. For example:
   + A video output named **high definition**.
   + A video output named **low definition**.
   + Audio English AAC named **AAC EN**.
   + Audio French AAC named **AAC FR**.
   + Audio English Dolby Digital named **DD EN**.
   + Audio French Dolby Digital named **DD FR**.
   + A rendition group named **AAC group** for AAC audio.
   + A rendition group named **DD group** for Dolby Digital audio.

1. Identify how you want the video to be associated with the audio rendition groups. For example:
   + Video **high definition** to be associated with **AAC group** and **DD group**.
   + Video **low definition** to be associated only with **AAC group**.

1. (Optional) For completeness in designing the output group, identify the captions that you require. 

![\[Diagram showing output group with AAC, Dolby, and WebVTT caption groups in English and French.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/ARG_twoV_twoA_twoC.png)


## Rules for video and audio in rendition groups
<a name="ARG-rules"></a>
+ Both video and captions are optional.
+ A video encode can be associated with more than one rendition group. For example, *video high* can be associated with both *Dolby audio* and *AAC audio*. There is no need to create separate video encodes for each rendition group.  
![\[Diagram showing two rendition groups connected to a single video encode.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/ARG_oneV_twoARG.png)
+ All the rendition groups associated with the same video must contain the same audio encodes. For example, if both the AAC group and the Dolby group are associated with the high definition video encode, both these groups must contain the same audio languages (perhaps English, French, and Spanish). 
+ An audio encode can belong to only one audio rendition group. 
+ An audio rendition group can be associated with more than one video. For example, the Dolby group can be associated with the high definition video encode and the low definition video encode. There is no need to create separate rendition groups for each video.  
![\[Diagram showing a rendition group connected to two separate video elements.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/ARG_twoV_oneARG.png)

# Determine Defaults and Selection Rules
<a name="ARG-step-defaults"></a>

As the second part of planning the audio rendition group, you should identify the following:
+ The rendition (if any) that is the default.
+ How auto-selection will work for the non-default renditions. 

This information might be useful to the client player that is playing this media asset. 
+ If a client player is configured with an audio preference (for example, Spanish) and that preference is not available, the player can use this information to select an audio. 
+ Or if the client player is not configured with any audio preference, the client player can use this information to select an audio.



(If the preference that is configured in the client player is available, the player ignores this information and selects that preference.)

**To determine defaults and auto-selection behavior**
+ For each audio rendition in the rendition group, choose the behavior from the following table. Each audio can have a different value. 

  Each row in the following table describes a different behavior.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/medialive/latest/ug/ARG-step-defaults.html)

**Example 1**  
In this example you want to set up the audio rendition group so that the client player can auto-select any of the renditions. You also want a default audio in the rendition group in case the client player is not set up with a default.  
+ Set only one audio rendition to *Alternate Audio, Auto Select, Default*.
+ Set every other audio rendition to *Alternate Audio, Auto Select, Not Default*.
+ Optionally, if you have an audio rendition that plays when the bandwidth is so low that the video cannot be delivered, then set that audio rendition to *Audio-Only Variant Stream*.

**Example 2**  
In this example you want to set up the audio rendition group so that the client player can auto-select only specific renditions. You also want a default audio in the rendition group in case the client player is not set up with a default.  
+ Set only one audio rendition to *Alternate Audio, Auto Select, Default*.
+ Set some of the other renditions to *Alternate Audio, Auto Select, Not Default*.
+ Set some of the other renditions to *Alternate Audio, not Auto Select*.
+ Optionally, if you have an audio rendition that plays when the bandwidth is so low that the video cannot be delivered, then set that audio rendition to *Audio-Only Variant Stream*.

**Example 3**  
In this example you want to set up the audio rendition group so that the client player can auto-select any audio rendition it chooses. You don't want a default audio rendition in the rendition group, so the client player always auto-selects audio.  
+ Set every audio rendition to *Alternate Audio, Auto Select, Not Default*.
+ Optionally, if you have an audio rendition that plays when the bandwidth is so low that the video cannot be delivered, then set that audio rendition to *Audio-Only Variant Stream*.

# Create the video outputs
<a name="ARG-step-create-video"></a>

If you want to include video in the HLS output group, then follow this procedure for each video encode.

This procedure involves the following fields in the output section of the HLS output group the Channel page in the console:
+ **Output settings** – **HLS settings**
+ **Output settings** – **HLS settings** – **Audio rendition sets**

**To create the video outputs**

1.  In the **HLS output group**, in **HLS outputs**, choose **Add output**. Choose **Settings** to display the **Outputs **page for that output.

1. In the **Output** page, set up as follows:
   + In **Stream settings**, choose **Audio 1** and choose **Remove audio**. The output now contains only a video encode. In an output group that includes audio rendition groups, each video encode must each be in a video-only output.
   + Set up the rest of the stream settings as described in [Fields for the video, audio, and captions streams (encodes)](hls-streams-section.md).

1. Complete the **Output settings** section as follows:
   + For **HLS settings**, choose **Standard hls** or **Fmp4**, as appropriate.
   + For **Audio rendition sets**, enter the name of the audio renditions groups to associate with this video output. Don't worry that you haven't created this name yet. To associate the video output with more than one group, enter a comma-separated list. For example:

     **AAC group, DD group**

# Create the audio outputs
<a name="ARG-step-create-audio"></a>

Follow this procedure for each audio encode in the HLS output group.

This procedure involves the following fields in the output section of the HLS output group the Channel page in the console:
+ **Output settings** – **HLS settings**
+ **Output settings** – **HLS settings** –** Audio track type**
+ **Output settings** – **HLS settings** – **Audio group ID**
+ **Output settings** – **HLS settings** – **Segment type**

**To create each audio output**

1.  In the **HLS output group**, in **HLS outputs**, choose **Add output**. Choose **Settings** to display the **Outputs **page for that output.

1. In the **Output** page, set up as follows:
   + In **Stream settings**, choose **Video 1** and choose **Remove video**. The output now contains only an audio encode. In an output group that includes audio rendition groups, each audio encode must each be in its own output.
   + Set up the rest of the stream settings in the usual way.

1. Complete the **Output settings** section as follows:
   + For **HLS settings**, choose **Audio only hls**. More fields appear.
   + For **Audio track type**, choose the value you decided on for this audio encode when you [determined the default](ARG-step-defaults.md).
   + For **Audio group ID**, enter the name of the rendition group that you want this audio encode to belong to. For example, enter **AAC group**. One audio encode can belong to only one rendition group. 
   + For **Segment type**, choose **AAC**.

   Ignore **Audio only image**. This field does not apply to audio rendition groups.

# Summary
<a name="ARG-create-summary"></a>

After following these steps, you have the following outputs:
+ Two or more audio-only outputs. Each output belongs to the audio rendition group specified in **Audio Group ID**.
+ Optionally, one or more video outputs. Each output is associated through the audio rendition group or groups specified in **Audio Rendition Sets**.