

# Fields for the output destination – sending to an HTTP server
HTTP server

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
Step 1: Design the path

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


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


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


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


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
Step 2: Complete the fields

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
HTTP example

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


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**