

# Managing router I/Os in MediaConnect
<a name="managing-router-io"></a>

Router I/Os are where your media streams enter and exit the router. Think of them as the connections between your router and your media sources and destinations.

You'll work with two types of router I/O:
+ **Router inputs **- These receive your content from sources such as live camera feeds, satellite downlinks, and studio productions
+ **Router outputs** - These deliver your content to destinations such as broadcast transmitters, a playout server, and monitoring displays

Each I/O can handle specific bitrates and protocols, which you set up during I/O creation. You can create as many router I/Os as you need and manage them all from one place, even if they're in different AWS Regions.

This chapter shows you everything you need to know about working with router I/Os.

**Topics**
+ [Creating a router I/O in MediaConnect](creating-router-io.md)
+ [Viewing router I/Os in MediaConnect](viewing-router-io.md)
+ [Updating a router I/O in MediaConnect](editing-router-io.md)
+ [Starting a router I/O in MediaConnect](starting-router-io.md)
+ [Stopping a router I/O in MediaConnect](stopping-router-io.md)
+ [Restarting a router I/O in MediaConnect](restarting-router-io.md)
+ [Deleting a router I/O in MediaConnect](deleting-router-io.md)
+ [MediaConnect router I/O states](io-state-changes.md)
+ [Integrating router I/Os with MediaConnect flows](integrate-flow-with-router.md)
+ [Integrating router I/Os with MediaLive](integrate-eml-with-router.md)
+ [Source failover and merge for router inputs in MediaConnect](router-input-failover.md)

# Creating a router I/O in MediaConnect
<a name="creating-router-io"></a>

When you create a router I/O, you'll configure its connection details and operating parameters. Each router I/O connects to an external endpoint, which can be a public IP address, or a private VPC IP address.

You can create two types of router I/Os:
+ A **router input**, which receives content from a source endpoint (like a live video feed)
+ A **router output**, which sends content to a destination endpoint (like a broadcast service)

MediaConnect assigns each router I/O a permanent IP address. This ensures stable connections between your external endpoints and router I/Os, even when you change internal routing assignments. These connections persist until you either update the I/Os or delete them.

When creating a router I/O, you must specify both a tier and a maximum bitrate. The tier you select determines the capacity limits, performance characteristics, and associated costs. The maximum bitrate must fall within the limits of your selected tier. There are separate tiers for inputs and outputs, each with different capacity limits. 

You can configure router I/Os with either a Regional routing scope or a global routing scope. By default, they use Regional scope, which restricts them to being assigned only to other router I/Os within the same AWS Region. You can optionally set the routing scope to global, which allows cross-Region routing (additional data transfer costs might apply). 

**Note**  
AWS charges you for active router I/Os based on the tier you select. When a router I/O is active, it charges the hourly rate for that tier. Cross-Region routing and public internet egress for outputs incur additional hourly charges when data transfer is active. For more information, see [MediaConnect pricing](https://aws.amazon.com/mediaconnect/pricing/).
For router inputs, MediaConnect manages incoming data transfers based on the tier's enforced bitrate limit. If content exceeds this limit, the source stream will be rejected. Router inputs have a fanout limit, determining the maximum number of outputs that can be simultaneously connected. This is set to 10. 
For router outputs, the maximum bitrate must be greater than or equal to the input it's assigned to. 

## Prerequisites
<a name="create-router-io-prerequisites"></a>
+ You have an AWS MediaConnect account.
+ You know the AWS Region where you want to create the router I/O.
+ You've identified the external endpoint that you want to connect to your router I/O.
+ You have [created a network interface](creating-router-network-interfaces.md).
+ If you want to connect your router I/O to a MediaConnect flow, your flow must be set up for router integration. For more information, see [Integrating router I/Os with MediaConnect flows](integrate-flow-with-router.md).
+ If you want to connect your router output to a MediaLive input, your MediaLive input must be set up for router integration. For more information, see [Integrating router I/Os with MediaLive](integrate-eml-with-router.md).
+ If you want to connect your router input to a MediaLive channel output, your MediaLive channel must have a MediaConnect Router output group configured. For more information, see [Integrating router I/Os with MediaLive](integrate-eml-with-router.md).

## Procedure
<a name="create-router-io-procedure"></a>

Follow these procedures to create a router input or a router output.

### To create a router input
<a name="create-router-input-section"></a><a name="create-router-input-procedure"></a>

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

1. In the navigation pane, choose **Router inputs**.

1. Choose **Create router input**.

1. Under **Router input details**, set up your input:

   1. **Name** - Give your input a descriptive name.
**Tip**  
Include details like the content type or source in the name (for example, **StudioA-Live** or **SatelliteFeed1**). This approach makes managing multiple inputs easier as your routing system grows.

   1. **Tier** - Select a tier based on your performance requirements. 

   1. **Maximum bitrate** - Specify the highest bitrate that you expect (in bits per second).
**Important**  
This setting acts as a hard limit. If the incoming content exceeds this bitrate on a sustained basis, the source stream will be suspended and will automatically resume when the bitrate returns to an acceptable range. 

   1. **Region** - Select an AWS Region where you want to create this input.
**Tip**  
Choose a Region close to your upstream content source for optimal performance.

   1. **Routing scope** - Select *regional* to restrict routing to outputs in the same AWS Region, or *global* to enable cross-region routing. 

1. Under **Input type**, choose an option and complete its configuration:

   1. **Standard** - To receive content from an external source endpoint, follow these steps: 

      1. Under **Standard router input configuration**, select a network interface to use. For public network interfaces, select the availability zone where the router input will be placed in. For VPC network interfaces, the availability zone is inferred from the network interface subnet. 

      1. Under **Protocol configuration**, select a protocol and set it up:

------
#### [ RIST ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Recovery latency** - Set your desired value in milliseconds.

------
#### [ RTP ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Forward error correction** - Choose whether to enable this feature.

------
#### [ SRT Caller ]

         1. **Source address** - Enter the IP address or domain name for the SRT connection.

         1. **Router input source port** - Specify the SRT Listener source port.

         1. **Minimum latency** - Specify the smallest buffer latency that you want to maintain between the source and the router input.

             
**Note**  
The SRT protocol uses a **minimum latency** configuration on each side of the connection. The larger of these two values is used as the *recovery latency*. If the transmitted bitrate, multiplied by the recovery latency, is higher than the *receiver buffer*, the buffer will overflow and the stream can fail with a `Buffer Overflow Error`. On the SRT receiver side, the receiver buffer is configured by the SRTO\$1RCVBUF value. The size of the receiver buffer is limited by the *flow control window size* (SRTO\$1FC) value. On the MediaConnect side, the receiver buffer is calculated as the **maximum bitrate** value multiplied by the **minimum latency** value. For more information about the SRT buffer, see [the SRT Configuration Guidelines.](https://github.com/Haivision/srt/blob/master/docs/API/configuration-guidelines.md)

         1. **Stream ID** - Enter the identifier for the stream.

         1. **SRT Caller decryption configuration** - If you want to enable decryption, follow these steps:

            1. Select **Enable decryption**.

            1. Under **Role ARN**, enter the ARN of the role that you created when you set up MediaConnect as a trusted entity.

            1. Under **Secret ARN**, enter the ARN that AWS Secrets Manager assigned when you created the secret to store the encryption key.

------
#### [ SRT Listener ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Minimum latency** - Specify the smallest buffer latency that you want to maintain between the source and the router input.
**Note**  
The SRT protocol uses a **minimum latency** configuration on each side of the connection. The larger of these two values is used as the *recovery latency*. If the transmitted bitrate, multiplied by the recovery latency, is higher than the *receiver buffer*, the buffer will overflow and the stream can fail with a `Buffer Overflow Error`. On the SRT receiver side, the receiver buffer is configured by the SRTO\$1RCVBUF value. The size of the receiver buffer is limited by the *flow control window size* (SRTO\$1FC) value. On the MediaConnect side, the receiver buffer is calculated as the **maximum bitrate** value multiplied by the **minimum latency** value. For more information about the SRT buffer, see [the SRT Configuration Guidelines.](https://github.com/Haivision/srt/blob/master/docs/API/configuration-guidelines.md)

         1. **SRT Listener decryption configuration** - If you want to enable decryption, follow these steps:

            1. Select **Enable decryption**.

            1. Under **Role ARN**, enter the ARN of the role that you created when you set up MediaConnect as a trusted entity.

            1. Under **Secret ARN**, enter the ARN that AWS Secrets Manager assigned when you created the secret to store the encryption key.

------

   1. **MediaConnect Flow** - To receive content from a flow, follow these steps.
**Note**  
This option requires a flow with an output that's been set up for router integration. For more information, see [Integrating router I/Os with MediaConnect flows](integrate-flow-with-router.md).   
 If you want to create the router input and connect the flow at a later time, select the **Do not connect to a MediaConnect flow** option and then select the availability zone where the router input will be placed in. Both the router input and the upstream flow must be placed in the same availability zone. 

      1. Under **MediaConnect flow ARN**, specify the flow that you want to connect to.

      1. Under **MediaConnect flow output ARN**, specify the output of the flow.

      1. Under **Flow transit decryption key type**, choose how to decrypt the flow’s encrypted content as it moves from the flow to the router input.

         1. **Automatic encryption key** - Choose this if you want automatic key management (recommended in most cases). With this option, MediaConnect will handle key creation and rotation for you.

         1. **AWS Secrets Manager encryption key** - Choose this if your security requirements require you to use your own encryption keys. Then, do the following:

            1. For **Role ARN**, enter the ARN of the IAM role that allows MediaConnect to access your encryption keys.

            1. For **Secret ARN**, enter the ARN of the secret in Secrets Manager that contains your encryption key. 
**Important**  
 The content of the secret must be an AES-256 key in hexadecimal format. The key must have 64 digits. 

   1. **MediaLive channel** - To receive content from a MediaLive channel output, follow these steps.
**Note**  
This option requires a MediaLive channel with a MediaConnect Router output group. For more information, see [Integrating router I/Os with MediaLive](integrate-eml-with-router.md).  
If you want to create the router input and connect the channel at a later time, select the **Do not connect to a MediaLive channel** option and then select the Availability Zone where the router input will be placed in. Both the router input and the MediaLive channel pipeline must be in the same Availability Zone.

      1. Under **MediaLive channel ARN**, specify the channel that you want to connect to.

      1. Under **Pipeline**, specify the pipeline ID of the channel output.

      1. Under **Output name**, specify the name of the channel output within the MediaConnect Router output group.

      1. Under **Source transit decryption key type**, choose how to decrypt content as it moves from the MediaLive channel to the router input. This must match the encryption type configured on the MediaLive channel output. For details about the available options, see [Encryption options](integrate-eml-with-router.md#eml-router-encryption).

   1. **Failover** - For failover configuration, follow these steps:

      1. Under **Failover router input configuration**, select the network interface and the protocol. For public network interfaces, select the availability zone where the router input will be placed in. For VPC network interfaces, the availability zone is inferred from the network interface subnet. 

      1. Under **First source protocol configuration**, define the protocol settings for the primary source.

------
#### [ RIST ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Recovery latency** - Set your desired value in milliseconds.

------
#### [ RTP ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Forward error correction** - Choose whether to enable this feature.

------
#### [ SRT Caller ]

         1. **Source address** - Enter the IP address or domain name for the SRT connection.

         1. **Router input source port** - Specify the SRT Listener source port.

         1. **Minimum latency** - Specify the smallest buffer latency that you want to maintain between the source and the router input.

             
**Note**  
The SRT protocol uses a **minimum latency** configuration on each side of the connection. The larger of these two values is used as the *recovery latency*. If the transmitted bitrate, multiplied by the recovery latency, is higher than the *receiver buffer*, the buffer will overflow and the stream can fail with a `Buffer Overflow Error`. On the SRT receiver side, the receiver buffer is configured by the SRTO\$1RCVBUF value. The size of the receiver buffer is limited by the *flow control window size* (SRTO\$1FC) value. On the MediaConnect side, the receiver buffer is calculated as the **maximum bitrate** value multiplied by the **minimum latency** value. For more information about the SRT buffer, see [the SRT Configuration Guidelines.](https://github.com/Haivision/srt/blob/master/docs/API/configuration-guidelines.md)

         1. **Stream ID** - Enter the identifier for the stream.

         1. **Decryption** - If you want to enable decryption, follow these steps:

            1. Select **Enable decryption**.

            1. Under **Role ARN**, enter the ARN of the role that you created when you set up MediaConnect as a trusted entity.

            1. Under **Secret ARN**, enter the ARN that AWS Secrets Manager assigned when you created the secret to store the encryption key.

------
#### [ SRT Listener ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Minimum latency** - Specify the smallest buffer latency that you want to maintain between the source and the router input.
**Note**  
The SRT protocol uses a **minimum latency** configuration on each side of the connection. The larger of these two values is used as the *recovery latency*. If the transmitted bitrate, multiplied by the recovery latency, is higher than the *receiver buffer*, the buffer will overflow and the stream can fail with a `Buffer Overflow Error`. On the SRT receiver side, the receiver buffer is configured by the SRTO\$1RCVBUF value. The size of the receiver buffer is limited by the *flow control window size* (SRTO\$1FC) value. On the MediaConnect side, the receiver buffer is calculated as the **maximum bitrate** value multiplied by the **minimum latency** value. For more information about the SRT buffer, see [the SRT Configuration Guidelines.](https://github.com/Haivision/srt/blob/master/docs/API/configuration-guidelines.md)

         1. **Decryption** - If you want to enable decryption, follow these steps:

            1. Select **Enable decryption**.

            1. Under **Role ARN**, enter the ARN of the role that you created when you set up MediaConnect as a trusted entity.

            1. Under **Secret ARN**, enter the ARN that AWS Secrets Manager assigned when you created the secret to store the encryption key.

------

      1. Under **Second source protocol configuration**, repeat the previous step for the secondary source using a different port number. 
**Note**  
When using RTP with FEC enabled for failover/merge on a router input, MediaConnect automatically reserves three ports: the port you specify, plus the ports that are \$12 and \$14 from that.   
For example, if you specify port 2000 for the input, MediaConnect will also reserve ports 2002 and 2004 for the FEC streams. 

      1. Under **Source priority configuration**, choose how sources are prioritized during failover scenarios. 

         1. **No priority** - Choose this if you want MediaConnect to treat the sources with equal priority and switch between them as needed. 

         1. **Primary/Secondary** - Choose this if you want to select one of the sources as a primary source. MediaConnect will switch to the secondary source if the primary source is not available, and will switch back to the primary source as soon as data returns. 

   1. **Merge** - For merge configuration, follow these steps:

      1. Under **Merge router input configuration**, select the network interface and the protocol, and define a recovery window in milliseconds. 

          For public network interfaces, select the availability zone where the router input will be placed in. For VPC network interfaces, the availability zone is inferred from the network interface subnet. 

         The recovery window is the size of the buffer (delay) that you want MediaConnect to maintain. A larger recovery window means a longer delay in transmitting the stream, but more room for error correction. A smaller recovery window means a shorter delay, but less room for error correction.

      1. Under **First source protocol configuration**, define the protocol settings for the first source.

------
#### [ RIST ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Recovery latency** - Set your desired value in milliseconds.

------
#### [ RTP ]

         1. **Port** - Enter the listening port for incoming content.

         1. **Forward error correction** - Choose whether to enable this feature.

------

      1. Under **Second source protocol configuration**, repeat the previous configuration step for the second source using a different port number. 
**Note**  
When using RTP with FEC enabled for failover/merge on a router input, MediaConnect automatically reserves three ports: the port you specify, plus the ports that are \$12 and \$14 from that.   
For example, if you specify port 2000 for the input, MediaConnect will also reserve ports 2002 and 2004 for the FEC streams. 

1. Under **Transit encryption key configuration**, choose how to encrypt content as it moves through the router's internal network.
**Note**  
This encryption applies only to content moving through the router matrix. It is separate from any encryption you configure between your source and input, or between your output and destination.

   1. **Automatic encryption key** - Choose this if you want automatic key management (recommended in most cases). With this option, MediaConnect will handle key creation and rotation for you.

   1. **AWS Secrets Manager encryption key** - Choose this if your security requirements require you to use your own encryption keys. Then, do the following:

      1. For **Role ARN**, enter the ARN of the IAM role that allows MediaConnect to access your encryption keys.

      1. For **Secret ARN**, enter the ARN of the secret in Secrets Manager that contains your encryption key.
**Important**  
 The content of the secret must be an AES-256 key in hexadecimal format. The key must have 64 digits. 

1. Under **Maintenance configuration**, choose an option:

   1. **Default** - Choose this if you want MediaConnect to define the maintenance schedule for you.

   1. **Preferred day and time** - Choose this if you want to define your own maintenance schedule.

1. Under **Tags**, define up to 50 tags to help you identify and organize this router input.

1. Choose **Create router input**.

### To create a router output
<a name="create-router-output-section"></a><a name="create-router-output-procedure"></a>

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

1. In the navigation pane, choose **Router outputs**.

1. Choose **Create router output**.

1. Under **Router output details**, set up your output:

   1. **Name** - Give your output a descriptive name.
**Tip**  
Include details like content type or destination in the name (such as **ControlRoom-Monitor** or **Affiliate1**). This can make managing multiple outputs easier as your routing system grows.

   1. **Tier** - Select a tier based on your performance requirements. 

   1. **Maximum bitrate** - Enter the highest bitrate you expect (in bits per second).
**Important**  
This setting affects which inputs your output can take a route from. To ensure routing compatibility, the output's maximum bitrate must be at least as large as the input bitrate. 

   1. **Region** - Select an AWS Region where you want to create this output. 
**Tip**  
Choose a Region close to your downstream content destination for optimal performance.

   1. **Routing scope** - Select *regional* to restrict routing from inputs in the same AWS Region, or *global* to enable cross-region routing. 

1. Under **Output type**, choose one of these options and complete its configuration. 

   1. **Standard** - To send content to an external source endpoint, follow these steps:

      1. Under **Standard router output configuration**, select a network interface to use. For public network interfaces, select the availability zone where the router output will be placed in. For VPC network interfaces, the availability zone is inferred from the network interface subnet. 

      1. Under **Protocol configuration**, select a protocol and set it up:

------
#### [ RIST ]

         1. **Destination address** - Specify where you're sending the content.

         1. **Port** - Specify the port to use.

------
#### [ RTP ]

         1. **Destination address** - Specify where you're sending the content.

         1. **Port** - Specify the port to use.

         1. **Forward error correction** - Choose whether to enable this feature.

------
#### [ SRT Caller ]

         1. **Destination address** - Enter the IP address or domain where you're sending the content to.

         1. **Port** - Specify the port to use.

         1. **Minimum latency** - Specify the smallest buffer latency that you want to maintain between the router output and the destination.
**Note**  
The SRT protocol uses a minimum latency configuration on each side of the connection. The larger of these two values is used as the *recovery latency*. If the transmitted bitrate, multiplied by the recovery latency, is higher than the *receiver buffer*, the buffer might overflow, causing the stream to fail with a `Buffer Overflow Error`. On the SRT receiver side, the receiver buffer is configured by the SRTO\$1RCVBUF value. The size of the receiver buffer is limited by the *flow control window size* (SRTO\$1FC) value. On the MediaConnect side, the receiver buffer is calculated as the maximum bitrate value multiplied by the minimum latency value. For more information about the SRT buffer, see [the SRT Configuration Guidelines](https://github.com/Haivision/srt/blob/master/docs/API/configuration-guidelines.md).

         1. **Stream ID** (optional) - Enter an identifier for the stream.

         1. **SRT Caller encryption configuration** - If you want to enable encryption, follow these steps:

            1. Select **Enable encryption**.

            1. Under **Role ARN**, enter the ARN of the role that you created when you set up MediaConnect as a trusted entity.

            1. Under **Secret ARN**, enter the ARN that AWS Secrets Manager assigned when you created the secret to store the encryption key.

------
#### [ SRT Listener ]

         1. **Port** - Specify the port to use.

         1. **Minimum latency** - Specify the smallest buffer latency that you want to maintain between the router output and the destination.
**Note**  
The SRT protocol uses a minimum latency configuration on each side of the connection. The larger of these two values is used as the *recovery latency*. If the transmitted bitrate, multiplied by the recovery latency, is higher than the *receiver buffer*, the buffer might overflow, causing the stream to fail with a `Buffer Overflow Error`. On the SRT receiver side, the receiver buffer is configured by the SRTO\$1RCVBUF value. The size of the receiver buffer is limited by the *flow control window size* (SRTO\$1FC) value. On the MediaConnect side, the receiver buffer is calculated as the maximum bitrate value multiplied by the minimum latency value. For more information about the SRT buffer, see [the SRT Configuration Guidelines](https://github.com/Haivision/srt/blob/master/docs/API/configuration-guidelines.md).

         1. **SRT Listener encryption configuration** - If you want to enable encryption, follow these steps:

            1. Select **Enable encryption**.

            1. Under **Role ARN**, enter the ARN of the role that you created when you set up MediaConnect as a trusted entity.

            1. Under **Secret ARN**, enter the ARN that AWS Secrets Manager assigned when you created the secret to store the encryption key.

------

   1. **MediaConnect Flow** - To send content to a flow, follow these steps.
**Note**  
This option requires a flow with a source that's been set up for router integration. For more information, see [Integrating router I/Os with MediaConnect flows](integrate-flow-with-router.md).   
 If you want to create the router output and connect the flow at a later time, select the **Do not connect to a MediaConnect flow** option and then select the availability zone where the router output will be placed in. Both the router output and the downstream flow must be placed in the same availability zone. 

      1. Under **MediaConnect flow ARN**, specify the flow that you want to connect to.

      1. Under **MediaConnect flow source ARN**, specify the source of the flow.

      1. Under **Transit encryption key type**, choose how to encrypt the content as it moves from the router output to the flow.

         1. **Automatic encryption key** - Choose this if you want automatic key management (recommended in most cases). With this option, MediaConnect will handle key creation and rotation for you.

         1. **AWS Secrets Manager encryption key** - Choose this if your security requirements require you to use your own encryption keys. Then, do the following:

            1. For **Role ARN**, enter the ARN of the IAM role that allows MediaConnect to access your encryption keys.

            1. For **Secret ARN**, enter the ARN of the secret in Secrets Manager that contains your encryption key.
**Important**  
 The content of the secret must be an AES-256 key in hexadecimal format. The key must have 64 digits. 

   1. **MediaLive input** - To send content to a MediaLive input, follow these steps.
**Note**  
This option requires a MediaLive input that's been set up for router integration. For more information, see [Integrating router I/Os with MediaLive](integrate-eml-with-router.md).   
 If you want to create the router output and connect the MediaLive input at a later time, select the **Do not connect to a MediaLive input** option and then select the availability zone where the router output will be placed in. Both the router output and the downstream MediaLive input must be placed in the same availability zone. 

      1. Under **MediaLive input ARN**, specify the input that you want to connect to.

      1. Under **Pipeline**, specify the pipeline that you want to use.

      1. Under **Transit encryption key type**, choose how to encrypt the content as it moves from the router output to the MediaLive input.

         1. **Automatic encryption key** - Choose this if you want automatic key management (recommended in most cases). With this option, MediaConnect will handle key creation and rotation for you.

         1. **AWS Secrets Manager encryption key** - Choose this if your security requirements require you to use your own encryption keys. Then, do the following:

            1. For **Role ARN**, enter the ARN of the IAM role that allows MediaConnect to access your encryption keys.

            1. For **Secret ARN**, enter the ARN of the secret in Secrets Manager that contains your encryption key.
**Important**  
 The content of the secret must be an AES-256 key in hexadecimal format. The key must have 64 digits. 

1. Under **Maintenance configuration**, choose an option:

   1. **Default** - Choose this if you want MediaConnect to define the maintenance schedule for you.

   1. **Preferred day and time** - Choose this if you want to define your own maintenance schedule.

1. Under **Tags**, define up to 50 tags to help you identify and organize this router output.

1. Choose **Create router output**.

## Next steps
<a name="create-router-io-next-steps"></a>
+ To view the router I/Os you've created, see [Viewing router I/Os in MediaConnect](viewing-router-io.md).
+ To start using your router I/O, see [Starting a router I/O in MediaConnect](starting-router-io.md).
+ To control how your media flows through the router, see [Managing routes in MediaConnect](assigning-route.md).

## Additional resources
<a name="create-router-io-additional-resources"></a>

To create router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [CreateRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_CreateRouterInput.html)
+ [CreateRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_CreateRouterOutput.html)

This includes information about how to use the `CreateRouterInput` and `CreateRouterOutput` operations and parameters in one of the language-specific AWS SDKs.

# Viewing router I/Os in MediaConnect
<a name="viewing-router-io"></a>

You can view your router inputs and outputs in the MediaConnect console. For each input and output, you can see the status, connections, and monitoring details.

## Prerequisites
<a name="viewing-router-io-prerequisites"></a>

The following procedure assumes you have at least one router I/O in your AWS account.

## Procedure
<a name="viewing-router-io-procedure"></a>

Follow these steps to view the router I/Os that are available in your AWS account.

### To view your router inputs
<a name="view-router-inputs-section"></a><a name="view-router-inputs-procedure"></a>

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

1. In the navigation pane, choose **Router inputs**.

1. Review the list of your inputs, which shows basic information such as the following:  
**Router inputs list fields**    
<a name="router-inputs-list-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediaconnect/latest/ug/viewing-router-io.html)

1. To see more information about a router input, select an input and choose **View details**.

1. Use these tabs to find specific information about the router input:  
**Router input details tabs**    
<a name="router-input-details-tabs-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediaconnect/latest/ug/viewing-router-io.html)

### To view your router outputs
<a name="view-router-outputs-section"></a><a name="view-router-outputs-procedure"></a>

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

1. In the navigation pane, choose **Router outputs**.

1. Review the list of your outputs, which shows basic information such as the following.  
**Router outputs list fields**    
<a name="router-outputs-list-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediaconnect/latest/ug/viewing-router-io.html)

1. To see more information about a router output, select an output and choose **View details**.

1. Use these tabs to find specific information about the router output.  
**Router output details tabs**    
<a name="router-output-details-tabs-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/mediaconnect/latest/ug/viewing-router-io.html)

## Next steps
<a name="viewing-router-io-next-steps"></a>

After reviewing your router inputs and outputs, you can perform the following actions:
+ [Starting a router I/O in MediaConnect](starting-router-io.md)
+ [Managing routes in MediaConnect](assigning-route.md)

## Additional resources
<a name="viewing-router-io-additional-resources"></a>

To view router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [ListRouterInputs](https://docs.aws.amazon.com/mediaconnect/latest/api/API_ListRouterInputs.html)
+ [ListRouterOutputs](https://docs.aws.amazon.com/mediaconnect/latest/api/API_ListRouterOutputs.html)
+ [GetRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_GetRouterInput.html)
+ [GetRouterInputThumbnail](https://docs.aws.amazon.com/mediaconnect/latest/api/API_GetRouterInputThumbnail.html) 
+ [GetRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_GetRouterOutput.html)
+ [BatchGetRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_BatchGetRouterInput.html)
+ [BatchGetRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_BatchGetRouterOutput.html)

This includes information about how to use these operations and parameters in one of the language-specific AWS SDKs.

# Updating a router I/O in MediaConnect
<a name="editing-router-io"></a>

When your requirements change, you can edit existing router I/Os to meet your needs. You can update the I/O name, description, maximum bitrate, protocol settings, and other configuration parameters at any time.

## Prerequisites
<a name="editing-router-io-prerequisites"></a>
+ The following procedure assumes you've already created at least one router I/O.
+ If you want to update a router I/O's maintenance configuration, you must ensure that the router I/O is in **Standby** state.
+ If you want to connect your router I/O to a MediaConnect flow, your flow must be set up for router integration. For more information, see [Integrating router I/Os with MediaConnect flows](integrate-flow-with-router.md).
+ If you want to connect your router output to a MediaLive input, your MediaLive input must be set up for router integration. For more information, see [Integrating router I/Os with MediaLive](integrate-eml-with-router.md).
+ If you want to connect your router input to, or disconnect it from, a MediaLive channel output, your MediaLive channel must have a MediaConnect Router output group configured. For more information, see [Integrating router I/Os with MediaLive](integrate-eml-with-router.md).

## Procedure
<a name="editing-router-io-procedure"></a>

### To update a router input
<a name="edit-router-input-section"></a><a name="edit-router-input-procedure"></a>

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

1. In the navigation pane, choose **Router inputs**.

1. Select the router input that you want to update and choose **Edit**.

1. Update the router input details as needed.

1. Choose **Save changes**.

1. Check the outcome:

   1. If successful: The router input will be updated with your changes.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

### To update a router output
<a name="edit-router-output-section"></a><a name="edit-router-output-procedure"></a>

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

1. In the navigation pane, choose **Router outputs**.

1. Select the router output that you want to update and choose **Edit**.

1. Update router output details as needed.

1. Choose **Save changes**.

1. Check the outcome:

   1. If successful: The router output will be updated with your changes.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

## Next steps
<a name="editing-router-io-next-steps"></a>

After you update a router I/O, you can [review the updated I/O](viewing-router-io.md) to verify that your updates were successful.

## Additional resources
<a name="editing-router-io-additional-resources"></a>

To update router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [UpdateRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_UpdateRouterInput.html)
+ [UpdateRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_UpdateRouterOutput.html)

This includes information about how to use these operations and their parameters in one of the language-specific AWS SDKs.

# Starting a router I/O in MediaConnect
<a name="starting-router-io"></a>

Before you can deliver content through the router, you must first start the router I/O that you want to use. This action changes the router input or output status to `Active`.

## Prerequisites
<a name="starting-router-io-prerequisites"></a>

The following procedure assumes that you've already created a router input or a router output.

## Procedure
<a name="starting-router-io-procedure"></a>

Follow these steps to start a router input or output.

### To start a router input
<a name="start-router-input-section"></a><a name="start-router-input-procedure"></a>

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

1. In the navigation pane, choose **Router inputs**.

1. Select the router input that you want to start.

1. Choose **Start**.

1. Check the outcome:

   1. If successful: You'll see the status change from **Standby** to **Starting**, and then to **Active**.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

### To start a router output
<a name="start-router-output-section"></a><a name="start-router-output-procedure"></a>

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

1. In the navigation pane, choose **Router outputs**.

1. Select the router output that you want to start.

1. Choose **Start**.

1. Check the outcome:

   1. If successful: You'll see the status change from **Standby** to **Starting**, and then to **Active**.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

## Next steps
<a name="starting-router-io-next-steps"></a>

You can now use these I/Os in your routing assignments. To assign routes between your inputs and outputs, see [Managing routes in MediaConnect](assigning-route.md).

## Additional resources
<a name="starting-router-io-additional-resources"></a>

To start router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [StartRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_StartRouterInput.html)
+ [StartRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_StartRouterOutput.html)

This includes information about how to use the `StartRouterInput` and `StartRouterOutput` operations and parameters in one of the language-specific AWS SDKs.

# Stopping a router I/O in MediaConnect
<a name="stopping-router-io"></a>

You can stop a router input or output when you need to temporarily pause its operation. When you stop an I/O, it changes to a `Standby` state and stops incurring charges.

Important things to know about stopping I/Os:
+ You can stop and start a router I/O at any time.
+ Stopping a router I/O doesn't affect your other I/Os or their takes.
+ When you stop an I/O, MediaConnect cancels any maintenance restarts that were scheduled when the I/O was started.
+ When you stop an I/O, its routing assignments remain in place. For example:
+ 
  + If you stop an output, it maintains its input assignment and will resume the same connection when restarted.
  + If you stop an input, connected outputs will stop receiving video, but their routing connections and capacity reservations are preserved.

## Prerequisites
<a name="stopping-router-io-prerequisites"></a>

Before you start, ensure you have:
+ An active router input or router output
+ No active processes that require the I/O

## Procedure
<a name="stopping-router-io-procedure"></a>

Follow these steps to stop a router input or a router output.

### To stop a router input
<a name="stop-router-input-section"></a><a name="deactivate-router-io-procedure"></a>

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

1. In the navigation pane, choose **Router inputs**.

1. Select the router input that you want to stop.

1. Choose **Stop**.

1. Check the outcome:

   1. If successful: The router input status will change to **Stopping**, then **Standby**.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

### To stop a router output
<a name="stop-router-output-section"></a><a name="deactivate-router-io-procedure"></a>

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

1. In the navigation pane, choose **Router outputs**.

1. Select the router output that you want to stop.

1. Choose **Stop**.

1. In the confirmation dialog, choose **Stop router output**.

1. Check the outcome:

   1. If successful: The router output status will change to **Stopping**, then **Standby**.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

## Next steps
<a name="stopping-router-io-next-steps"></a>

After stopping an I/O, you can:
+ [Restart the I/O](starting-router-io.md) later when needed.
+ [Delete the I/O](deleting-router-io.md) if you won't use it again.
+ [Create a new I/O](creating-router-io.md) with different settings.

## Additional resources
<a name="stopping-router-io-additional-resources"></a>

To stop router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [StopRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_StopRouterInput.html)
+ [StopRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_StopRouterOutput.html)

This includes information about how to use the `StopRouterInput` and `StopRouterOutput` operations and parameters in one of the language-specific AWS SDKs.

# Restarting a router I/O in MediaConnect
<a name="restarting-router-io"></a>

You can manually restart your router I/Os in MediaConnect when you need to perform maintenance or system updates. MediaConnect automatically performs maintenance restarts every 60-66 days from the initial start date. However, manual restarts give you additional flexibility to manage your router I/Os on your own schedule.

## Prerequisites
<a name="restarting-router-io-prerequisites"></a>

Before you start, ensure that you have an active router input or output.

## Procedure
<a name="restarting-router-io-procedure"></a>

Follow these steps to restart a router input or output.

### To restart a router input
<a name="restart-router-input-section"></a><a name="restart-router-input-procedure"></a>

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

1. In the navigation pane, choose **Router inputs**.

1. Select the router input that you want to restart.

1. Choose **Restart**.

1. Check the outcome:

   1. If successful: The router input status changes to **Migrating** while it restarts, and then returns to **Active**.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

### To restart a router output
<a name="restart-router-output-section"></a><a name="start-router-output-procedure"></a>

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

1. In the navigation pane, choose **Router outputs**.

1. Select the router output that you want to restart.

1. Choose **Start**.

1. Check the outcome:

   1. If successful: The router output status changes to **Migrating** while it restarts, then returns to **Active**.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

## Next steps
<a name="restarting-router-io-next-steps"></a>

After manually restarting an I/O, you can: 
+ [Monitor its status](viewing-router-io.md) in the console
+ [View the countdown](viewing-router-io.md) until the next scheduled maintenance restart
+ [Update the maintenance schedule if needed](editing-router-io.md) (must put I/O in standby mode first)

## Additional resources
<a name="restarting-router-io-additional-resources"></a>

To start router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+  [ RestartRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_RestartRouterInput.html) 
+ [RestartRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_RestartRouterOutput.html)

This includes information about how to use the `RestartRouterInput` and `RestartRouterOutput` operations and parameters in one of the language-specific AWS SDKs.

# Deleting a router I/O in MediaConnect
<a name="deleting-router-io"></a>

When you no longer need a router input or output, you can delete it from your configuration. This permanently removes the I/O and frees up its resources. You might delete a router I/O when you want to switch to a different routing setup or clean up your unused resources.

**Important**  
Deleting a router I/O is permanent and can't be undone. When you delete a router I/O, any takes using this router I/O will be removed.

## Prerequisites
<a name="deleting-router-io-prerequisites"></a>

Before you start:
+ Make sure that the I/O you want to delete is either in `Standby` or `Stopping` state.
+ Make sure that the router I/O isn’t connected to a flow or a MediaLive channel.
+ For inputs: Ensure the input is not assigned to any outputs.
+ Consider documenting the I/O's configuration in case you need to recreate it later.

## Procedure
<a name="deleting-router-io-procedure"></a>

### To delete a router input
<a name="delete-router-input-section"></a><a name="delete-router-input-procedure"></a>

**To delete a router input**

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

1. In the navigation pane, choose **Router inputs**.

1. Select the input that you want to delete and choose **View resources**.

1. Choose **Delete**.

1. In the dialog box that appears, choose **Delete router input** to confirm your decision.

1. Check the outcome:

   1. If successful: The router output status will change to `Deleted`.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

### To delete a router output
<a name="delete-router-output-section"></a><a name="delete-router-output-procedure"></a>

**To delete a router output**

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

1. In the navigation pane, choose **Router outputs**.

1. Select the router output that you want to delete and choose **View resource**.

1. Choose **Delete**.

1. In the dialog box that appears, choose **Delete router output **to confirm your decision.

1. Check the outcome:

   1. If successful: The router output status will change to `Deleted`.

   1. If unsuccessful: You'll see an error message explaining what went wrong.

## Next steps
<a name="deleting-router-io-next-steps"></a>

After deleting an I/O, you can:
+ [Create a new router I/O](creating-router-io.md) with different settings if needed.
+ [Review your remaining router I/Os](viewing-router-io.md) to ensure your routing setup is complete.

## Additional resources
<a name="deleting-router-io-additional-resources"></a>

To delete router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [DeleteRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_DeleteRouterInput.html)
+ [DeleteRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_DeleteRouterOutput.html)

This includes information about how to use the `DeleteRouterInput` and `DeleteRouterOutput` operations and parameters in one of the language-specific AWS SDKs.

# MediaConnect router I/O states
<a name="io-state-changes"></a>

An AWS Elemental MediaConnect router I/O transitions through different states from the moment you create it through to the moment you delete it. These states can be grouped into several categories:
+ Operational transitions: **Starting** and **Stopping** states manage the activation of an I/O
+ Settings updates: The **Updating** state handles modifications to an I/O’s configuration 
+ Route updates: The **Migrating** state handles modifications to an I/O’s route assignment

 The following illustration shows the I/O lifecycle and the transitions between I/O states. Note that depending on the type of I/O, it may begin its lifecycle directly in the **Standby** state, bypassing the **Creating** state.

![\[State diagram showing MediaConnect router I/O lifecycle. Main states are Creating, Standby, and Active, with transition states (Starting/Stopping) between them. Updating and Migrating states branch from both Standby and Active, returning to their origin state. The lifecycle ends with Deleting state. Black arrows show transitions, blue arrows indicate returns.\]](http://docs.aws.amazon.com/mediaconnect/latest/ug/images/router-io-state-diagram.png)


## State definitions
<a name="io-state-definitions"></a>

The following definitions describe each state in detail, in the order you might typically encounter them:

**Creating**  
MediaConnect is creating the router I/O and setting up the necessary resources and configurations. During this process, the service prepares the I/O to handle content routing and establishes its initial settings.

**Standby**  
The router I/O is ready for use. This is the default state after you create or stop an I/O. In this state, the I/O is fully configured and idle, but is prepared to start processing content as soon as you activate it.

**Starting**  
This is a transition state where MediaConnect is starting up the router I/O to prepare for content processing. The service activates the necessary components to begin handling media streams according to the I/O's configuration.

**Active**  
The router I/O is actively processing content. For inputs, this means receiving content from the source and making it available for routing. For outputs, this means receiving routed content and sending it to the configured destination. 

**Updating**  
This is a configuration change state where MediaConnect is updating specific settings for the I/O, such as the protocol configuration or maximum bitrate. During this state, the service applies the requested changes while maintaining the I/O's existing connections and routing assignments.

**Migrating**  
This is a configuration change state where the router I/O is being reassigned to a different route. This happens when you update a route (such as when an output takes a new input as part of normal broadcast switching operations). This state indicates that the I/O is in the process of migrating from one routing assignment to another.

**Stopping**  
This is a transition state where MediaConnect is stopping the router I/O's operations. The service stops content processing and prepares the I/O to return to the Standby state.

**Deleting**  
MediaConnect is in the process of permanently removing the router I/O. After this state, the router I/O will no longer exist.

In addition, the following states manage error handling:

**Error**  
This is an error handling state where the router I/O has encountered an issue that prevents normal operation. Common issues that can trigger this state include network connectivity problems, resource constraints, or configuration conflicts. The I/O remains in this state until MediaConnect can initiate recovery procedures or until manual intervention resolves the underlying issue.

**Recovering**  
This is an error handling state where MediaConnect is attempting to resolve issues that caused the I/O to enter an error state. During this state, MediaConnect works to restore the I/O's functionality based on its configured settings and routing assignments.

# Integrating router I/Os with MediaConnect flows
<a name="integrate-flow-with-router"></a>

You can integrate your AWS Elemental MediaConnect flows with your router I/Os to extend your media workflow capabilities. This enables you to combine the flexibility of the router with the distribution features of flows. 

You can connect your flows to your router setup in two ways: 

1. **Use a flow as a source for a router input** 

   When you connect a flow to a router input, you can incorporate existing flow workflows into your routing setup. This is useful when you want to: 
   + Route content from existing flows through the router matrix
   + Combine flow and router capabilities in the same workflow
   + Maintain existing flow setups while adding routing capabilities 

1. **Use a flow as a destination for a router output** 

   When you connect a router output to a flow, you can use your flow as a distribution amplifier for your routed content. This setup is useful when you want to: 
   + Distribute router output to multiple destinations
   + Enable cross-account access through flow entitlements
   + Send content to AWS Elemental MediaLive using managed outputs 

## Prerequisites
<a name="integrate-flow-with-router-prerequisites"></a>

Before you start, review these important considerations:
+ **For connections between router inputs and flows**
  + The router inputs and flow outputs must be in the same availability zone and AWS Region.
  + A flow output can connect to one router input at a time. To switch connections, disconnect the flow output first.
  + You can't delete connected resources. You must disconnect the flow from the router input before you can delete either resource. 
+ **For connections between router outputs and flows**
  + If the flow has two sources, both sources must be connected to the router output. 
  + A router output can connect to one flow at a time. 
  + You can connect two router outputs to two flow sources on the same flow and perform fail over between them. 
  + Only failover is supported between flow sources. Merge is not supported.
  + You can't delete connected resources. You must disconnect the flow from the router output before you can delete either resource. 
  + When switching the content being routed to a connected flow source, we recommend using the **Take Router Input** operation on the connected router output. This performs a faster and cleaner switch than changing the router output directly, which can potentially cause brief video interruptions.

## Procedure
<a name="integrate-flow-with-router-procedure"></a>

### Connecting a flow to a router input
<a name="integrate-flow-with-router-input-section"></a><a name="integrate-flow-with-router-input-procedure"></a>

**To connect a flow output to a router input**

1. [Add an output](outputs-add.md) to your flow, making sure that the flow output has **Router integration** enabled. 

1. [Create](creating-router-io.md) or [update](editing-router-io.md) a router input with the following settings:
   + Choose **Flow** as the configuration type
   + Specify the desired flow output from step 1

1. [Start the flow](flows-start.md). 

1. [Start the router input](starting-router-io.md).

When the router input and the flow are running, and the router input is assigned to an active router output, the stream is forwarded from the flow through the router.

### Connecting a router output to a flow
<a name="integrate-flow-with-router-output-section"></a><a name="integrate-flow-with-router-output-procedure"></a>

**To connect a router output to a flow source**

1. [Create](outputs-add.md) or [update](flows-update.md) a flow, making sure that the flow source has **Router integration** enabled. 

1. [Create](creating-router-io.md) or [update](editing-router-io.md) a router output with the following settings:
   + Choose **Flow** as the configuration type
   + Specify the desired flow source from step 1

1. [Start the flow](flows-start.md). 

1. [Start the router output](starting-router-io.md).

When the router output and the flow are running, and the router output is taking an active router input, the stream is forwarded through the router to the flow.

## Additional resources
<a name="integrate-flow-with-router-additional-resources"></a>

Connection management is focused on the router. You use the router API operations to select a flow output to feed into your router input, or a flow source to receive content from your router output.

To connect flows to router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [CreateRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_CreateRouterInput.html)
+ [CreateRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_CreateRouterOutput.html)
+ [UpdateRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_UpdateRouterInput.html)
+ [UpdateRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_UpdateRouterOutput.html)

This includes information about how to use these operations and parameters in one of the language-specific AWS SDKs.

# Integrating router I/Os with MediaLive
<a name="integrate-eml-with-router"></a>

You can integrate your AWS Elemental MediaLive channels with your router I/Os in AWS Elemental MediaConnect. This enables you to combine the flexibility of the router with the processing and encoding capabilities of MediaLive.

You can connect MediaLive to your router setup in two ways:

1. **Use a MediaLive input as a destination for a router output**

   When you connect a router output to a MediaLive input, you can send routed content to MediaLive for processing. This is useful when you want to:
   + Incorporate MediaLive channels into your routing workflow
   + Dynamically switch which routed content is sent to MediaLive for processing

1. **Use a MediaLive channel output as a source for a router input**

   When you connect a MediaLive channel output to a router input, you can route processed content for global distribution. This is useful when you want to:
   + Use MediaLive processing features like content normalization, SCTE-35 processing, and clip replay before routing
   + Distribute MediaLive output across regions using the router's cross-region capabilities

## Prerequisites
<a name="integrate-eml-with-router-prerequisites"></a>

Before you start, ensure that:
+ You have administrator permissions for MediaConnect
+ You can coordinate with a MediaLive operator who has administrator permissions for MediaLive
**Note**  
This page describes the process from the MediaConnect perspective, assuming coordination with an operator managing MediaLive. One operator can perform both roles if they have the necessary permissions.
+ Your MediaLive operator has configured the necessary permissions for MediaLive to interact with MediaConnect. They can choose their preferred approach:
  + **Simple option**

    Use the `MediaLiveAccessRole`, which includes all necessary permissions for MediaLive to work with MediaConnect. This is the simplest option, and we recommend it for most use cases. For instructions, see [Create the trusted entity - simple option](https://docs.aws.amazon.com/medialive/latest/ug/setup-trusted-entity-simple.html).
  + **Complex option**

    Create your own IAM policy and role if you need more specific custom permissions. For instructions, see [Create the trusted entity - complex option](https://docs.aws.amazon.com/medialive/latest/ug/setup-trusted-entity-complex.html).

Keep in mind the following important considerations when using this feature:
+ The router I/O and the MediaLive pipeline must be in the same Availability Zone and AWS Region.
+ The encryption scheme on the router side must match the encryption scheme on the MediaLive side.
+ You can't delete connected resources. You must disconnect them first.
+ A MediaLive resource (input or channel output) can only be connected to one router I/O at a time.
+ You need the appropriate MediaLive permission on the target resource (`medialive:UpdateInput` for inputs, `medialive:UpdateChannel` for channels).

## Encryption options
<a name="eml-router-encryption"></a>

You can use the following encryption options for content moving between MediaConnect and MediaLive:

Automatic encryption key  
MediaConnect and MediaLive handle encryption automatically with no manual key management required. This is the simplest option, and we recommend it for most use cases.

AWS Secrets Manager encryption key  
Use this option if you must manage your own encryption keys. To use this option, provide the following:  
+ **Role ARN** – The ARN of the IAM role that allows the service to access your encryption keys.
+ **Secret ARN** – The ARN of the secret in Secrets Manager that contains your encryption key.
The content of the secret must be an AES-256 key in hexadecimal format. The key must have 64 digits.
If you use AWS Secrets Manager encryption, make sure the encryption configuration matches on both the MediaConnect and MediaLive sides. Both services must be authorized to access the secret.

## Procedure
<a name="integrate-eml-with-router-procedure"></a>

Follow the steps for the direction of integration that you want to set up.

### Connecting a router output to a MediaLive input
<a name="integrate-eml-with-router-output-section"></a><a name="integrate-eml-with-router-output-procedure"></a>

**To connect a router output to a MediaLive input**

1. **Create an input in MediaLive**

   Ask your MediaLive operator to create an input with the following settings:
   + The input type must be **MediaConnect router**.
   + They must specify an Availability Zone for each pipeline.
     + For a single-pipeline input, specify one Availability Zone.
     + For a standard (dual-pipeline) input, specify two Availability Zones.
   + The pipeline ID must be either 0 or 1.
   + Choose the encryption type. For more information, see [Encryption options](#eml-router-encryption).

   After creation, the MediaLive input appears in the MediaConnect console as an available destination for your router output.

1. **Create a router output in MediaConnect**

   Create or update a router output with the following settings:
   + Choose **MediaLive input** as the output type.
   + Specify the ARN of the MediaLive input from step 1.
   + Specify the pipeline ID (0 or 1).
   + Choose the encryption type to match the MediaLive input. For more information, see [Encryption options](#eml-router-encryption).

1. **Create a channel in MediaLive**

   The MediaLive operator must create a MediaLive channel and attach the MediaLive input from step 1. With this setup in place, you can send video from the MediaConnect router to MediaLive.

### Connecting a MediaLive channel output to a router input
<a name="integrate-eml-with-router-input-section"></a><a name="integrate-eml-with-router-input-procedure"></a>

**To connect a MediaLive channel output to a router input**

1. **Create a MediaConnect Router output group in MediaLive**

   Ask your MediaLive operator to configure the channel with a MediaConnect Router output group with the following settings:
   + Specify an Availability Zone for each pipeline.
   + Add one or more outputs to the output group.
   + Choose the encryption type. For more information, see [Encryption options](#eml-router-encryption).

1. **Create a router input in MediaConnect**

   Create or update a router input with the following settings:
   + Choose **MediaLive channel** as the input type.
   + Specify the ARN of the MediaLive channel from step 1.
   + Specify the pipeline ID (0 or 1).
   + Specify the output name from the Router output group.
   + Choose the decryption type to match the MediaLive channel output. For more information, see [Encryption options](#eml-router-encryption).
**Note**  
You can create the router input in a disconnected state and connect it to the MediaLive channel output later.

1. **Start the channel and router input**

   Start both the MediaLive channel and the router input. With this setup in place, you can send processed content from MediaLive to the MediaConnect router.

## Troubleshooting
<a name="integrate-eml-with-router-troubleshoot"></a>

If you encounter issues with this workflow, use this checklist to identify and resolve common problems:
+ The MediaLive resource (input or channel) that you specified exists in your AWS account.
+ The MediaLive resource is the correct type (MediaConnect router input type for inputs, or a channel with a MediaConnect Router output group configured).
+ The router I/O and the MediaLive pipeline are in the same Availability Zone and AWS Region.
+ The encryption scheme on the router side matches the encryption scheme on the MediaLive side.
+ You have the appropriate MediaLive permission on the target resource (`medialive:UpdateInput` for inputs, `medialive:UpdateChannel` for channels).
+ The MediaLive resource is not already connected to another router I/O.

## Additional resources
<a name="integrate-eml-with-router-additional-resources"></a>

Connection management is focused on the router. You use the router API operations to create router inputs and outputs that connect to MediaLive channels and inputs.

To connect MediaLive resources to router I/Os programmatically, see the following pages in the *MediaConnect API Reference*:
+ [CreateRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_CreateRouterInput.html)
+ [CreateRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_CreateRouterOutput.html)
+ [UpdateRouterInput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_UpdateRouterInput.html)
+ [UpdateRouterOutput](https://docs.aws.amazon.com/mediaconnect/latest/api/API_UpdateRouterOutput.html)

This includes information about how to use these operations and parameters in one of the language-specific AWS SDKs.

# Source failover and merge for router inputs in MediaConnect
<a name="router-input-failover"></a>

MediaConnect supports two types of redundancy configurations for router inputs: **Failover** and **Merge**. 

## Failover mode
<a name="router-input-failover-mode"></a>

In failover mode, a router input can have two sources. The router input will automatically switch sources based on the source priority configuration. If no priority is defined, the router input will randomly use one of the sources and will switch to the other source if the active source does not send data for 500 milliseconds. If one source is defined as the *Primary* source, the router input will use the primary source and will switch to the secondary source if the primary source does not send data for 500 milliseconds. The router input will switch back to the primary source as soon as data returns. 

To create a failover router input, you specify the input type as **Failover** and provide a protocol configuration for each source. MediaConnect treats the first source as the primary, and the second as the backup. 

For instructions on how to create or update a router input, see [Creating a router I/O in MediaConnect](creating-router-io.md) and [Updating a router I/O in MediaConnect](editing-router-io.md). 

## Merge mode
<a name="router-input-merge-mode"></a>

In merge mode, a router input accepts two identical, simultaneous video streams on the same IP address but different ports. MediaConnect merges the content of the two streams at the network packet level, allowing a graceful recovery from any single-source loss. For example: if the router input is using source A and packet 123 is missing, MediaConnect pulls in packet 123 from source B and continues using source A. 

To create a merge router input, you specify the router input type as **Merge** and provide a protocol configuration for each source. The two sources must be binary identical, which means that they need to have originated from the same encoder. Additionally, if the sources use RTP protocol, they must have RTP headers with aligned sequence numbers and they must also comply with the SMPTE ST 2022-7 standard. 

When configuring a merge router input, you can also set a recovery window. This is the size of the buffer (delay) that you want MediaConnect to maintain. A larger recovery window means a longer delay in transmitting the stream, but more room for error correction. A smaller recovery window means a shorter delay, but less room for error correction.

For instructions on how to create or update a router input, see [Creating a router I/O in MediaConnect](creating-router-io.md) and [Updating a router I/O in MediaConnect](editing-router-io.md).

## Supported protocols
<a name="router-input-failover-table"></a>

The following table describes which source protocols support failover and merge for MediaConnect router inputs.


| Protocol | Does this protocol support source failover? | How many sources can be added? | Supported failover modes | 
| --- | --- | --- | --- | 
| RIST | Yes | 2 | Merge or failover | 
| RTP | Yes | 2 | Merge or failover | 
| SRT listener | Yes | 2 | Failover only | 
| SRT caller | Yes | 2 | Failover only | 