

# 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.