

# Setting up an RTMP push input
<a name="input-create-rtmp-push"></a>

This section describes how to set up an upstream system that uses the RTMP Push protocol to deliver source content from the public internet. It describes how to set up the source content on the upstream system, how to create an input security group, and how to create an input that connects the upstream system to MediaLive. 

With an RTMP Push input, the upstream system *pushes* the content to MediaLive. 

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

**Topics**
+ [Obtain information](setup-rtmp-push-obtain-info.md)
+ [Create an input security group](setup-isg-rtmp.md)
+ [Create an RTMP push input](setup-input-rtmp-push.md)
+ [Ensure correct setup on the upstream system](setup-uss-rtmp-push.md)
+ [Result of this procedure](setup-result-rtmp-push.md)

# Obtain information
<a name="setup-rtmp-push-obtain-info"></a>

Obtain the following information from your contact person at the upstream system:
+ The application name and application instance for the source content. (The application instance is also known as the *stream* or *stream key*.) There are two sources for a standard-class input, or one source 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). For information about input classes and their uses, see [Choosing the channel class and input class](class-channel-input.md). 

  The operator of the upstream system might already have rules for assigning these names. If not, you might have names that you would like to use. Make sure that you and the operator of the upstream system are clear about these names.

  In this example, the application name and instance name are identical. But they could be different:

  Application name: `live`, and instance name `curling`

  Application name: `live`, and instance name `curling`
+ The public network IP addresses. These are the sets of IP addresses where the source or sources for the content will appear on the public network. You need this information to create the input security group. 

  For example:
  + For one source: `203.0.113.19, 203.0.113.58, 203.0.113.25`
  + For the other source: `198.51.100.19, 198.51.100.59, 198.51.100.21`

  These addresses are the addresses shown in the red boxes in [the diagram after this procedure](setup-result-rtmp-push.md).

# Create an input security group
<a name="setup-isg-rtmp"></a>

You must create an input security group. The security group must allow the *public network IP addresses* to push to MediaLive. Following from the earlier example, it must allow these addresses:

203.0.113.19, 203.0.113.58, 203.0.113.25, 198.51.100.19, 198.51.100.59, 198.51.100.21

For details about creating an input security group, see [Creating an input security group](create-input-security-groups.md).

# Create an RTMP push input
<a name="setup-input-rtmp-push"></a>

After you have created the input security group, you can create the RTMP push input. 

**To create an RTMP push input**

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

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

1. On the **Inputs** page, choose **Create input**.

1. Complete the **Input details** section:
   + **Input** name – enter a name.
   + **Input type** – choose **RTMP (push)**. 

1. In the **Network mode** section, choose **Public**.

1. In the **Input security group** section, specify the group to attach to this push input. You can choose an existing group, or you can create a group. The security group must allow the public network IP addresses to push to MediaLive. Following from the example in step 1, it must allow these addresses:

   203.0.113.19, 203.0.113.58, 203.0.113.25, 198.51.100.19, 198.51.100.59, 198.51.100.21

   For more information about security groups, see [Working with input security groups](working-with-input-security-groups.md). 

1. In the **Channel and input class** section, choose the class for this input:
   + STANDARD
   + SINGLE-PIPELINE 

   For more information, see [Implementing pipeline redundancy](plan-redundancy-mode.md).

1. In the **Input destinations** section, in the **Destination** section, enter the application names and application instances you previously obtained:
   + If the input is a standard-class input, complete both fields, to specify two sources.
   + If the input is a single-class input, complete the first field with the information that you obtained and leave the second field empty.

   For example:

   **Application name: **`live`

   **Application instance:** `curling`

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 automatically creates two endpoints on that input. The endpoints include the application name, the application instance, and the port 1935. For example:

   `198.51.100.99:1935/live/curling`

   `192.0.2.18:1935/live/curling`

   Note that the IP addresses are addresses that MediaLive creates. They aren't the public addresses that you used in the security group. For a diagram that shows the role of all the IP addresses, see [Result of this procedure](setup-result-rtmp-push.md) in the section about setting up an RTMP push source.

   MediaLive always creates two endpoints:
   + If you will set up the channel as a standard channel, both endpoints will be used. 
   + If you will set up the channel as a single-pipeline channel, only the first endpoint will be used. MediaLive won't expect to receive content at the second endpoint. 

# Ensure correct setup on the upstream system
<a name="setup-uss-rtmp-push"></a>

You must make sure that the upstream system pushes content to the correct locations in MediaLive.

**To set up for a standard channel**

Follow this procedure if the MediaLive channel is a [standard channel](plan-redundancy.md).

1. Provide the operator with this information:
   + The two endpoints (URLs) that MediaLive generated when you created the RTMP input. These endpoints are the addresses in the blue boxes in [the diagram after this procedure](setup-result-rtmp-push.md). The URLs include port 1935. For example: 

     `198.51.100.99:1935/live/curling`

     `192.0.2.18:1935/live/curling`

1. Make sure that the operator sets up properly for a single-pipeline channel or a standard channel. 

   If your channel is a single-pipeline channel, the operator delivers only one source, even though the input is a standard (dual-pipeline) input. The operator must do the following:
   + Deliver one source.
   + Make sure that the sources appear on the agreed IP addresses on the public network. For example:
     + The sources could appear on these addresses: `203.0.113.19, 203.0.113.58, 203.0.113.25`
     + The operator can ignore the other addresses: `198.51.100.19, 198.51.100.59, 198.51.100.21`

     You used these addresses when you created the input security group. If the upstream system doesn't use these addresses, MediaLive will refuse the push.
   + Push to one URL on MediaLive, and use the agreed application name and instance name. For example:

     Push to this URL: `198.51.100.99:1935/live/curling`

     Ignore the other URL: `192.0.2.18:1935/live/curling`

   If your channel is a standard channel, the operator must do the following:
   + Deliver two sources that are identical in terms of video resolution and bitrate.
   + Make sure that the sources appear on the agreed IP addresses on the public network. For example:
     + For one source: `203.0.113.19, 203.0.113.58, 203.0.113.25`
     + For the other source: `198.51.100.19, 198.51.100.59, 198.51.100.21`

     You used these addresses when you created the input security group. If the upstream system doesn't use these addresses, MediaLive will refuse the push.
   + Push to the correct URLs on MediaLive, and use the agreed application name and instance name. For example, they must push to:

     `198.51.100.99:1935/live/curling`

     `192.0.2.18:1935/live/curling`

# Result of this procedure
<a name="setup-result-rtmp-push"></a>

As a result of this setup, an RTMP push input exists that specifies one or two *endpoint* URLs. These endpoints are on MediaLive and are fixed for the lifetime of the input, regardless of changes that occur (such as modifying other information in the input, or attaching the input to a different channel).

The upstream system has been set up to push the source content to the two endpoints (for a standard channel) or to the first endpoint (for a single-pipeline channel). An input security group has been associated with the input. This input security group has a CIDR block that covers the IP addresses where the pushed source will appear on the public network, which ensures that MediaLive accepts the pushed content.

Keep in mind that with a push input, the upstream system must be pushing the video source to the input when you start the channel. The upstream system does not need to be pushing before then. 

At runtime of the channel, MediaLive reacts to the content that is being pushed and ingests it. 

![\[Upstream system diagram showing IP addresses and RTMP inputs for MediaLive streaming.\]](http://docs.aws.amazon.com/medialive/latest/ug/images\rtmp-push-uss-input.png)
