

# Ways to work with MediaLive
<a name="getting-started"></a>

Here are three suggestions about how to get started with AWS Elemental MediaLive.
+ Use the workflow wizard to quickly create a functioning channel. See [Using the MediaLive workflow wizard](wizard.md).

  The wizard provides a compact user experience and supports some easy and popular input (source) types and output types. 

  If you are new to video encoding, the wizard can get you started, and might be all that you need. 

  If you are already experienced with video encoding, the wizard lets you quickly create a basic workflow that you can then enhance, using the regular MediaLive console.
+ Follow the [tutorial](getting-started-tutorial.md).

  You might follow the wizard to create a workflow, then decide that you need to add more features to the workflow. The tutorial provides an introduction to the basic workings of the MediaLive console.
+ Start designing a workflow, either from scratch, or to enhance the workflow wizard. In this case, you should read the guide, starting with the sections that are prefixed with *Setup*. These sections provide detailed instructions on designing your workflow, and designing the channel inside that workflow. These sections contain cross references to the remaining sections in the guide.

**Topics**
+ [Workflow wizard](wizard.md)
+ [Tutorial](getting-started-tutorial.md)

# Using the MediaLive workflow wizard
<a name="wizard"></a>

The AWS Elemental MediaLive workflow wizard lets you quickly get an MediaLive channel up and running. The wizard creates a channel and inputs (if they don't already exist). But it also creates related resources in other services (such as a channel in AWS Elemental MediaPackage). So it helps with the entire workflow, not just with the MediaLive portion.

**Topics**
+ [About the workflow wizard](wizard-about.md)
+ [Using the workflow wizard](wizard-procedure.md)
+ [Next steps—novice users](wizard-next-step-novice.md)
+ [Next steps—experienced video users](wizard-next-step-experienced.md)

# About the workflow wizard
<a name="wizard-about"></a>

## Supported inputs
<a name="wizard-inputs"></a>

To use the workflow wizard, you must ingest a single source from one of the following:
+ A flow in AWS Elemental MediaConnect.
+ Content from an AWS Elemental Link hardware device.
+ Content from a mobile phone or webcam. The source is delivered using the RTMP protocol.
+ An MP4 file stored on Amazon S3 or an HTTP server.

## Supported outputs
<a name="wizard-outputs"></a>

With the workflow wizard, you can extract one video asset and one audio asset from the source and convert it to one or more of the following types of output:
+ Output to send to an AWS Elemental MediaPackage channel, for delivery to Amazon CloudFront. CloudFront distributes the content to your end users.
+ Output to send to an AWS Elemental MediaStore container, for delivery to CloudFront. CloudFront distributes the content to your end users.
+ Output to Facebook, Twitch, or YouTube.

## Low-touch setup
<a name="wizard-low-touch"></a>

The workflow wizard automatically performs as much setup as possible in the upstream system. For example, your source might be in MediaConnect but you might not have created the flow. In this case, the workflow wizard automatically creates the flow for you.

The workflow wizard also automatically performs as much setup as possible in the downstream system or systems. For example, you might be sending to MediaPackage, but you might not have created the MediaPackage channel and might not have set up CloudFront. In this case, the workflow wizard performs the setup in those services. 

The workflow wizard works best when you use it to create these resources, rather than using existing resources. 

# Using the workflow wizard
<a name="wizard-procedure"></a>

## Creating a workflow
<a name="wizard-create"></a>

1. Determine which type of output or outputs you need. 

   If you're not sending to Facebook, Twitch, or YouTube, your major decision is whether to use MediaPackage or MediaStore. If you plan to repackage the output, choose [MediaPackage](https://aws.amazon.com/mediapackage/). If you don't know about repackaging and suspect that you don't need it, you could choose [MediaStore](https://aws.amazon.com/mediastore/). You can always modify the workflow later, if you find you made the wrong decision.

1. Determine which type of source you have. If necessary, speak to the person who is providing the source. 

1. If the source is using the RTMP protocol, you must set up an input security group using the regular MediaLive console. See [Working with input security groups](working-with-input-security-groups.md).

1. Make sure that you have set up the IAM permissions that your users must have so that they can create and run the workflow. See [Setting up IAM permissions for users](setting-up-for-production.md), and specifically [Reference: summary of non-administrator user access requirements](setup-users-step-1-summary.md)

1. Sign in to the AWS Management Console and open the MediaLive console at [https://console.aws.amazon.com/medialive/](https://console.aws.amazon.com/medialive/).

1. Choose **Workflow wizard** from the navigation panel. Follow the steps in the workflow wizard.

1. After you choose **Create** on the page, details about the workflow appear. A card appears for each resource that the workflow wizard involves. 

   The workflow wizard creates a CloudFormation stack. CloudFormation runs that stack to create all the other resources:
   + One MediaLive input.
   + One MediaLive channel.
   + All the resources in all AWS services that are involved in the workflow you have created. You workflow might involve MediaPackage, MediaStore, and CloudFront. 

1. When the resources have all been created, you can choose **Start workflow** on the details page for the workflow. The wizard starts the channel. The wizard also starts the MediaConnect flow, if you have one.

## Modifying a workflow
<a name="wizard-modify"></a>

You can't use the workflow wizard to modify an existing workflow. For suggestions about making changes, see [Next steps—novice users](wizard-next-step-novice.md) and [Next steps—experienced video users](wizard-next-step-experienced.md).

## Deleting a workflow
<a name="wizard-delete"></a>

You can delete the workflow. MediaLive handles the resources that belong to the workflow as follows:
+ It always deletes the channel.
+ It always deletes the CloudFormation stack.
+ It deletes the input, if the workflow wizard created it. It doesn't delete the input if the input already existed.
+ It deletes the flow associated with a MediaConnect input (if there is one), if the workflow wizard created the flow.
+ It deletes the MediaPackage channel (if there is one) and its endpoints.
+ It attempts to delete the MediaStore container, if there is one and if the workflow wizard created it. Deletion will fail if the container has any objects in it, including objects that aren't associated with this workflow.
+ It deletes the CloudFront distribution, if the workflow wizard created it.

# Next steps—novice users
<a name="wizard-next-step-novice"></a>

If you are new to the world of video streaming and have fairly modest requirements, you might find that the workflow wizard implements all the features you need, and that the **Workflow Details** page gives you the monitoring details and runtime controls you require.

But if you want, you can use the regular MediaLive console to add more features to the channel. For example, you could add captions to the output (assuming that the source includes captions). See [Editing and deleting a channel](editing-deleting-channel.md) for information about modifying the channel.

If you created a workflow that involves MediaStore, MediaPackage, and CloudFront, you should read the user guides for those services, to better understand their roles, and for information on the features of those services that you could add.

You should also read the information on pricing for MediaLive, and for other AWS services, so that you understand the AWS charges that your workflow incurs. For information about MediaLive charges, see [Pricing in MediaLive](pricing.md).

# Next steps—experienced video users
<a name="wizard-next-step-experienced"></a>

If you have experience with video streaming and with other AWS services, you might want to add more MediaLive resources and more resources from other AWS services to the workflow. Following are some of the ways that you can revise the workflow. 
+ You can work with each service, using the AWS console or an AWS SDK. For example, you can use the MediaLive console to add more MediaLive inputs to the channel. Or you can use the AWS CLI to create a MediaStore container and then create a new MediaLive output in your channel that uses that container as a destination.
+ You can use CloudFormation to revise the CloudFormation stack, to include more resources for CloudFormation to create. For example, you could create and attach more MediaLive inputs. Or you could add an AWS Lambda function to the workflow. For more information, display the details page for the workflow in the MediaLive console, then choose the appropriate link.
+ You can use the Media Services Application Mapper (MSAM) to monitor your resources. For more information, display the details page for the workflow in the MediaLive console, then choose the appropriate link.

If you created a workflow that involves MediaStore, MediaPackage, and CloudFront, you should read the user guides for those services, to better understand their roles, and for information on feature of those services that you could add.

You should also read the information on pricing for MediaLive, and for other AWS services, so that you understand the AWS charges that your workflow incurs. For information about MediaLive charges, see [Pricing in MediaLive](pricing.md).

# AWS Elemental MediaLive tutorial
<a name="getting-started-tutorial"></a>

This tutorial describes how to ingest a video source from an RTP source and generate one HLS output that contains one H.264 video encode and one audio encode. MediaLive will send the output to AWS Elemental MediaPackage. The output will consist of the following: 
+ One parent manifest: channel.m3u8
+ One rendition manifest: channel-1.m3u8
+ TS files for each output: channel-1.00001.ts, channel-1.00002.ts, channel-1.00003.ts, and so on

This tutorial uses the default values for most configuration fields in the channel.

**Note**  
All the text marked as an example in this tutorial is just that—a sample that shows what a piece of information typically looks like. You must replace each example with the information that is valid for your situation.

**Topics**
+ [Prerequisites for the tutorial](getting-started-prerequisites.md)
+ [Step 1: Set up the upstream system](getting-started-step1.md)
+ [Step 2: Set up the downstream system](getting-started-step2.md)
+ [Step 3: Create an input](getting-started-step3.md)
+ [Step 4: Set up key information](getting-started-step4.md)
+ [Step 5: Attach the input](getting-started-step4b.md)
+ [Step 6: Set up input video, audio, captions](getting-started-step4a-input-selectors.md)
+ [Step 7: Create an HLS output group](getting-started-step5.md)
+ [Step 8: Set up the output and encodes](getting-started-step6.md)
+ [Step 9: Create your channel](getting-started-step7.md)
+ [Step 10: Start the upstream system and the channel](getting-started-step8.md)
+ [Step 11: Clean up](getting-started-step9.md)

# Prerequisites for the tutorial
<a name="getting-started-prerequisites"></a>

Before you can use MediaLive, you need an AWS account and the appropriate permissions to access, create, and view MediaLive components. Complete the steps in [Preliminary steps for setting up to use MediaLive](setting-up.md), and then return to this tutorial. You can't use MediaLive, even as an administrator with full access, until you perform those steps.

# Step 1: Set up the upstream system
<a name="getting-started-step1"></a>

The upstream system is the system that streams the video to MediaLive. The upstream system can be anything from an on-premises appliance that is serving as a "contribution encoder" to an application running on a smart phone. You must perform some setup of your upstream system before you start working with MediaLive. 

For the purposes of this tutorial, the upstream system must be capable of sending a video stream via RTP push. 

In a "push" delivery, the upstream system is pushing the stream *from *two IP addresses on the upstream system (for example, from **203.0.113.111** and from **203.0.113.112**). The upstream system will push *to* two IP addresses on MediaLive (for example, **rtp://198.51.100.10:5000** and **rtp://192.0.2.131:5000**). In the following steps, you will set up MediaLive so that the two *from* IP addresses are white listed. Furthermore, MediaLive will generate the two *to* IP addresses. You will set up the upstream system to push to those addresses.

**To set up the upstream system**

1. Set up your upstream system to perform an RTP push from two different IP addresses. You must push from two addresses because MediaLive always expects redundant inputs.

1. Make a note of the IP addresses. For example, **203.0.113.111** and from **203.0.113.112**. You will need these addresses when you set up the input security group in a later step. 

# Step 2: Set up the downstream system
<a name="getting-started-step2"></a>

In this tutorial, the downstream system (the destination for the output from MediaLive) is AWS Elemental MediaPackage. 

You must set up a channel in AWS Elemental MediaPackage, and you must set it up now because you need the two URLs that MediaPackage generates. These URLs are input URLS from the point of view of MediaPackage. They are destination URLs for the output, from the point of view of MediaLive.

**To set up the downstream system**

1. Sign in to the AWS Management Console and open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In a new web browser tab or window, display the [Getting Started for AWS Elemental MediaPackage](https://docs.aws.amazon.com/mediapackage/latest/ug/getting-started.html) and follow steps 1 to 3 to create one channel and its endpoint.

1. Make a note of the data that AWS Elemental MediaPackage has generated: two input URLs and their associated names and passwords. For example, the data for one input URL might be:
   + `https://39fuo4.mediapackage.us-east-1.amazonaws.com/in/v1/88dpie/channel`
   + `ue739wuty`
   + `due484u`

   Your channel might be in a different Region from the example.

1. Keep the web browser open; don't close it yet.

# Step 3: Create an input
<a name="getting-started-step3"></a>

You must create an input. the input defines how the upstream system provides the source video stream to MediaLive. in this tutorial, you create an rtp input. 

You must also create an input security group for the input. this input security group applies the rule "only this specific IP address (an IP address that you own) can push to this input on MediaLive." without the protection of this rule, any third party could push content to an MediaLive input if they know the IP address and port of the input. 

**To create an input and input security group**

1. Sign in to the AWS Management Console and 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. In the **Input details** section, for **Input name**, enter **my rtp push**.

1. For **Input type**, choose **rtp**. 

1. in the **Input security group** section, choose **Create**. 

1. In the text box, enter the IP address that you noted in [Step 1: Set up the upstream system](getting-started-step1.md) of this tutorial. Enter the address as a CIDR block. for example, **203.0.113.111/32** and **203.0.113.112/32**.

1. Choose **Create input security group**.

1. Choose **Create** to create the input.

   MediaLive adds the input to the list of inputs and automatically creates two destinations (one primary and one redundant). these destinations include the port 5000. for example, **rtp://198.51.100.10:5000** and **rtp://192.0.2.131:5000**. these are the two locations where the upstream system must push the source. 

1. make a note of these two addresses because you will need them in [Step 10: Start the upstream system and the channel](getting-started-step8.md).

# Step 4: Set up key information
<a name="getting-started-step4"></a>

The first step to creating a channel from scratch is to choose the IAM role that MediaLive will use to access the channel when the channel is running (started) and specify key characteristics of the input. Now you are ready to start creating a channel. The first step is to identify the input. The channel contains the details that instruct MediaLive how to transcode (decode and encode) and package that input into specific outputs.

The first step to creating a channel from scratch is to choose the IAM role that MediaLive will use to access the channel when the channel is running (started) and specify key characteristics of the input.

**To specify key information for the channel**

1. On the MediaLive console, in the navigation pane, choose **Channels**.

1. In the **Channels** section, choose **Create channel**. 

1. In the **Channel and input details** pane, in **General info**, for **Channel name**, enter **Test channel**.

1. For **IAM role**, choose **Create role from template** and choose **Create IAM role**. The **Use existing role** list now shows the role **MediaLiveAccessRole**.

1. Choose **Remember role**.

# Step 5: Attach the input
<a name="getting-started-step4b"></a>

Now you are ready to identify the input that the channel will ingest.

**To attach the input to the channel**

1. On the **Create channel** page, in the navigation pane, for **Input attachments**, choose **Add**.

1. In **Attach input** , for **Input**, **My RTP push** (the input that you created.) 

   The **Attachment name** field is automatically populated with the name of the input itself. You can leave this name as is. 

1. Choose **Confirm**. The **Input attachment** section closes, and the **General input settings** section appears.

# Step 6: Set up input video, audio, captions
<a name="getting-started-step4a-input-selectors"></a>

You can create "selectors" to identify the specific video, audio, and captions that you want to extract from the input. 

In this tutorial, you don't create a video selector. Instead, when the channel starts, MediaLive will automatically select the video (or the first video) in the input. You also don't create a captions selector Typically, you include captions in the channel configuration, but in this tutorial we omit them.

You do create an audio selector.

**To identify the content to extract**

1. On the **Create channel** page, in the **Input settings** pane, for **Audio** selectors, choose **Add audio selectors**.

1. For **Audio selector name**, enter **My audio source**.

   Ignore the **Selector settings** field. You don't need to specify the PID or language. When the channel starts, MediaLive will automatically select the first audio, which is acceptable for this tutorial.

1. For all other fields in this pane, keep the default values. 

# Step 7: Create an HLS output group
<a name="getting-started-step5"></a>

Once you have set up the input, you continue with the channel creation by creating an output group. In this tutorial, you set up an HLS output group.

**To create an output group**

1. On the **Create channel** page, in the **Output groups** section, choose **Add**. 

1. In the **Add output group** section, choose **HLS**, and then choose **Confirm**. 

1. In the **HLS group destination A** section, for **URL**, enter the first input URL that AWS Elemental MediaPackage created for you in [Step 2: Set up the downstream system](getting-started-step2.md). For example, **https://39fuo4.mediapackage.us-east-1.amazonaws.com/in/v1/88dpie/channel**``. 

1. For **Credentials**:
   + For **Username**, enter the user name that corresponds to this URL. For example, **ue739wuty**. 
   + For **Password**, choose **Create parameter**. For **Name**, enter **DestinationA-MyHLS**. For **Password**, enter the password that corresponds to the URL. For example, **due484u**.

1. Choose **Create parameter**.

   You have created a parameter called **DestinationA-MyHLS** that holds the password **due484u**. The parameter is stored in the AWS Systems Manager Parameter Store. For more information, see [About the feature for creating password parameters](requirements-for-EC2.md#about-EC2Password).

1. For **HLS group destination B**, for **URL**, enter the second input URL that AWS Elemental MediaPackage created for you in [Step 2: Set up the downstream system](getting-started-step2.md). For example, **https://mgu654.mediapackage.us-east-1.amazonaws.com/in/v1/xmm9s/channel**. 

1. For **Credentials**:
   + For **Username**, enter the user name that corresponds to this URL. For example, **883hdux**. 
   + For **Password**, choose **Create parameter**. For **Name**, enter **DestinationB-MyHLS**. For **Password**, enter the password that corresponds to the URL. For example, **634hjik**.

1. Choose **Create parameter**.

   You have created a parameter called **DestinationB-MyHLS** that holds the password **634hjik**. The parameter is stored in the AWS Systems Manager Parameter Store. 

1. In the **HLS settings** section, for **Name**, enter **MyHLS**. 

1. For **CDN settings**, choose **Hls webdav**. This is the connection that AWS Elemental MediaPackage (the downstream system for the channel output) uses. 

   Leave the defaults for all the other **CDN settings** fields.

1. For all other fields in this pane, keep the default values.

# Step 8: Set up the output and encodes
<a name="getting-started-step6"></a>

Now that you have defined one output group in the channel, you can set up an output ins that output group, and specify how you want to encode the video output and the audio output.

**To set up the output**

1. In the **Output groups** section, choose **Output 1**. MediaLive automatically added this output when you created the output group. In addition, MediaLive automatically set up the output with one video and one audio, as shown in the **Stream settings** section. 

1. In **Stream settings**, choose **Video**.

1. For **Video description name**, change the default name to **H264 video**.

1. For **Codec settings**, choose **H264**.

   Leave the remaining fields with the default values. Specifically, keep **Width** and **Height** empty to use the same width as the input.

1. In **Stream settings**, choose **Audio 1**.

1. For **Audio description name**, change the default name to **AAC audio**.

1. For **Audio selector name**, enter **My audio source**, which is the audio selector that you created in[Step 6: Set up input video, audio, captions](getting-started-step4a-input-selectors.md).

1. For **Codec settings**, choose **AAC**.

1. Leave the remaining fields with the default values. 

# Step 9: Create your channel
<a name="getting-started-step7"></a>

You have entered the minimum required information, so you are ready to create the channel.

**To create the channel**
+ On the **Create channel** page, under the **Channel** section, choose **Create channel**. 

  The **Channel** section reappears and shows the newly created channel, named **MyHLS**. The state changes to **Creating**, then **Ready**.

# Step 10: Start the upstream system and the channel
<a name="getting-started-step8"></a>

You can now start the upstream system in order to push the streaming content to MediaLive, encode the content, and send it to AWS Elemental MediaPackage. You can preview the output on MediaPackage.

**To start the upstream system**

1. In your upstream system, start streaming the video sources that you set up in [Step 1: Set up the upstream system](getting-started-step1.md). Set them up to push to the two destinations that you noted in [Step 3: Create an input](getting-started-step3.md). These are two addresses in the input in MediaLive. For example, **rtp://198.51.100.10:5000** and **rtp://192.0.2.131:5000**. 

1. On the **Channels** list, choose the channel.

1. Choose **Start**. The channel state changes to **Starting**, then to **Running**.

1. Switch to the web browser tab or window where the AWS Elemental MediaPackage is displayed. 

1. Choose the channel link (not the radio button). On the details page, under **Endpoints**, choose **Play**. A preview window appears. 

1. Start the video. The output from AWS Elemental MediaLive starts playing.

# Step 11: Clean up
<a name="getting-started-step9"></a>

To avoid extraneous charges, delete this channel and input when you have finished working with it.

**To delete the channel**

1. On the **Channels** page, choose the channel.

1. If needed, choose **Stop**.

1. Choose **Delete**.

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

1. Choose **Delete**.