

# Setting up an MP4 input
MP4 input

This section describes how to set up the source content on the upstream system, and how to create an MP4 input that connects the content source to MediaLive. 

With an MP4 input, MediaLive connects to the upstream system when the channel starts and *pulls* the sources. 

To perform this setup, you must work with an operator at the upstream system.

**Topics**
+ [

# Obtain information
](setup-mp4-obtain-info.md)
+ [

# Create an MP4 input
](setup-input-mp4.md)
+ [

# Ensure correct setup on the MP4 upstream system
](setup-uss-mp4.md)
+ [

# Result of this procedure
](setup-result-mp4.md)

# Obtain information
Step 1: Obtain information

Obtain the following information from the operator at the upstream system:
+ The URLs on the upstream system for the source file or files. 

  There are two URLs for a standard-class input, or one URL for a single-class input. For information about input classes and their uses, see [Choosing the channel class and input class](class-channel-input.md).

  See the table later in this section for the URL format and for examples.

  Make a note of the full URLs.
+ The user name and password to access the upstream system, if the upstream system requires authenticated requests. Note that these user credentials relate to user authentication, not to the protocol. User authentication is about whether the upstream system will accept your request. The protocol is about whether the request is sent over a secure connection.

The following tables show the format of the URLs on the different types of upstream systems that MediaLive supports for MP4 input. 

**Upstream server is an HTTP or HTTPS server**


|  |  | 
| --- |--- |
| Format of URL | <protocol>//:<hostname>/<filename>.mp4 | 
| Example | https://203.0.113.13/filler-videos/oceanwaves.mp4`https://198.51.100.54/filler-videos/oceanwaves.mp4` | 

**Upstream server is AWS Elemental MediaStore**


|  |  | 
| --- |--- |
| Format of URL | mediastoressl://<data endpoint for container>/<path>/<filename>.mp4 | 
| Example |  Assume that the data endpoint for the container for one of the content sources is the following: **f31z.data.mediastore.us-west-2.amazonaws.com**.  Assume that the file is called `oceanwaves.mp4`, and it is stored in the container, in the path `filler-video`.  The URL for one of the source files would be: **mediastoressl://f31z.data.mediastore.us-west-2.amazonaws.com/filler-video/oceanwaves.mp4**   | 

**Upstream server is Amazon S3**


| Upstream server | Format of URL | 
| --- | --- | 
| Format of URL | s3ssl://<bucket>/<path>/<filename>.mp4 | 
| Example |  `s3ssl://amzn-s3-demo-bucket/filler-videos/main/oceanwaves.mp4`  `s3ssl://amzn-s3-demo-bucket/filler-videos/redundant/oceanwaves.mp4` With MediaLive, the S3 bucket name must not use dot notation, which means it mustn't use . (dot) between the words in a name.  | 

# Create an MP4 input
Step 2: Create input

After you have obtained information from the upstream system, you can create an MP4 input.

**To create an MP4 pull input**

1. Make sure that you have the information from [step 1](setup-mp4-obtain-info.md).

1. If this input is being used in a multiple-input channel, you should have decided whether to set it up as a static input or a [dynamic input](dynamic-inputs.md). You might need to modify the URLs you obtained from the upstream system:
   + If the input is a static input, don't modify the URLs.
   + If the input is a dynamic input, set up the URL as an optional absolute portion and a required variable portion (\$1urlPath\$1). For examples, see the table after this procedure.

     We recommend that you use the format <protocol>/\$1urlPath\$1.

1. Open the MediaLive console at [https://console.aws.amazon.com/medialive/](https://console.aws.amazon.com/medialive/).

1. In the navigation pane, choose **Inputs**. On the **Inputs** page, choose **Create input**.

1. Complete the **Input details** section:
   + **Input** name – enter a name.
   + **Input type** – choose **MP4**. 

1. In the **Input class** section, choose the class for this input:
   + STANDARD\$1INPUT
   + SINGLE\$1INPUT

1. In the **Input sources** section, enter the URLs you previously obtained: 
   + If the input is a standard-class input, complete both fields, to provide two URLs.
   + If the input is a single-class input, complete the first field with the URL that you obtained and leave the second field empty.

   If the upstream system requires that you provide user credentials, you must also enter the user name and password key for accessing the location. These credentials are stored on the Systems Manager Parameter Store. For more information, see [About the feature for creating password parameters](requirements-for-EC2.md#about-EC2Password).

1. In the **Tags **section, create tags if you want to associate tags with this input. For more information, see [Tagging resources](tagging.md).

1. Choose **Create**.

   MediaLive creates the input and adds it to the list of inputs. The input specifies either one or two sources. The sources don't appear in the list, but if you choose the **Name** link, the details page shows them. 

## Formats for the URL in a dynamic input


The following table describes the different formats for the URL in a dynamic input. 


| Format | Description | Example | Example of the \$1urlPath\$1 | 
| --- | --- | --- | --- | 
| <protocol>/\$1urlPath\$1 | URL has only the protocol in the absolute portion | s3ssl://\$1urlPath\$1 | amzn-s3-demo-bucket/my-movie.mp4 | 
| <protocol and path>/\$1urlPath\$1 | URL has the protocol and path in the absolute portion | mediastoressl://f31z.data.mediastore.us-west-2.amazonaws.com/movies/\$1urlPath\$1  | my-movie.mp4 | 
| \$1urlPath\$1 | URL has only the variable portion | \$1urlPath\$1 | s3ssl://amzn-s3-demo-bucket/my-movie.mp4 | 

# Ensure correct setup on the MP4 upstream system
Step 3: Set up upstream system

An operator at the upstream server must set up the source content on the upstream system. Make sure that the operator sets up as follows:
+ They set up to deliver the correct number of sources:
  + If the MediaLive channel is a standard channel, the operator must set up two file sources. They must make sure that the two files are identical in terms of video resolution and bitrate.
  + If the MediaLive channel is a single-pipeline channel, the operator must set up one file source. 
+ They set up to make the content available at the agreed URLs. These URLs are the URLs that you obtained [earlier in this section](setup-mp4-obtain-info.md), and that you configured into the MP4 input. They correspond to the URLs shown in [the diagram after this procedure](setup-result-mp4.md).

# Result of this procedure


As a result of this setup, a MediaLive input exists that specifies one or two *source* URLs. These sources are the URLs for the source content on the upstream server. 

When you start the channel, MediaLive will connect to the upstream system at this source location or locations and pull the content: 
+ For a standard channel, MediaLive expects the upstream system to provide two sources and will therefore attempt to pull from both source locations.
+ For a single-pipeline channel, MediaLive expects the upstream system to provide one source and will therefore attempt to pull from one source location. 

![\[Diagram showing MP4 input retrieval from two S3 bucket locations in MediaLive.\]](http://docs.aws.amazon.com/medialive/latest/ug/images/mp4-pull-uss-input.png)
