Setting up a live streaming workflow with Open Broadcaster Software (OBS) and AWS MediaLive involves configuring OBS to capture and broadcast live video, while AWS MediaLive processes the stream and outputs it to destinations like CloudFront or a content delivery network (CDN). This guide outlines the necessary steps to configure both OBS and AWS MediaLive to deliver high-quality, low-latency live streams.
Prerequisites
Before streaming from OBS to AWS MediaLive, it's important to have the right components in place for a smooth setup. This includes configuring your AWS environment, preparing OBS with the correct output settings, and ensuring proper network access. Laying this groundwork ensures a reliable and efficient streaming experience. Before setting up the live stream, ensure the following components are in place:
- AWS MediaLive Account: You need an active AWS account and permission to access MediaLive services.
- OBS Studio: Open Broadcaster Software (OBS) is required for video capture and stream encoding.
- AWS Access: Your AWS account should have valid access keys for configuring AWS resources.
Create an Input in AWS MediaLive
Creating an input in AWS MediaLive is a key step in setting up a live video workflow. Inputs define the source of your video, whether it's a live stream from an on-premises encoder or a file in the cloud. By properly configuring inputs, you ensure seamless delivery to your MediaLive channel. Let"s walk through how to set it up efficiently.
Step 1: Log in to your AWS Management Console.
Step 2: Navigate to AWS MediaLive and click Create Input.
Step 3: Choose RTMP Push as the input type, as OBS will push the stream using RTMP.
Step 4: Provide a name for your input and configure any additional settings as needed.
Step 5: After the input is created, AWS MediaLive will generate a stream URL and stream key. This URL is what you will use to configure OBS.
Using AWS CLI to Create an RTMP Input:
aws medialive create-input --name "MyOBSStream" --type RTMP_PUSHExplanation:
- aws medialive create-input: Creates a new input for AWS Elemental MediaLive using the AWS CLI.
- --name "MyOBSStream": Sets the name of the input to MyOBSStream.
- --type RTMP_PUSH: Specifies the input type as RTMP_PUSH, allowing MediaLive to receive a stream pushed from a source like OBS.
Configure OBS for Streaming
Configuring OBS (Open Broadcaster Software) for streaming ensures high-quality broadcasts tailored to your platform and audience. With the right settings, you can balance performance and video quality, whether you're streaming games, webinars, or live events. Here's how to set up OBS for a smooth and professional stream.
Step 1: Open OBS Studio and go to Settings > Stream.
Step 2: In the Service dropdown, select Custom....
Step 3: In the Server field, enter the RTMP URL from AWS MediaLive.
Step 4: In the Stream Key field, enter the stream key provided by AWS MediaLive.
Step 5: Click OK to save your settings.
OBS Settings for Streaming
rtmp://<your-aws-stream-url>/live
Stream Key: <your-aws-stream-key>Explanation:
- rtmp://<your-aws-stream-url>/live: RTMP endpoint used to send a live video stream to AWS MediaLive or a similar streaming service.
- Stream Key: <your-aws-stream-key>: Unique identifier required to authenticate and route the incoming stream to the correct input in the streaming service.
Create a Channel in AWS MediaLive
Creating a channel in AWS MediaLive is essential for processing and delivering live video streams. A channel connects your input source to output destinations while handling encoding, transcoding, and packaging. Setting it up correctly ensures smooth, real-time content delivery tailored to various devices and platforms.
Step 1: In the AWS MediaLive Console, navigate to Channels and click Create Channel.
Step 2: Select the input you created in Step 1.
Step 3: Configure your encoding settings, such as resolution and bitrate. AWS MediaLive will automatically select encoding profiles that match your input configuration.
Step 4: Set the output destination, which could be a CloudFront distribution or a standard HTTP endpoint.
AWS CLI to Create a Channel
aws medialive create-channel \
--name "MyLiveChannel" \
--input-attachments '[{"InputId":"<input-id>"}]' \
--role-arn "<IAM-role-arn>" \
--destinations '[{"Id":"destination1","Settings":[{"Url":"rtmp://your-cloudfront-distribution-domain/app"}]}]'Explanation:
- aws medialive create-channel: Creates a new AWS MediaLive channel using the AWS CLI.
- --name "MyLiveChannel": Assigns the name MyLiveChannel to the MediaLive channel.
- --input-attachments '[{"InputId":"<input-id>"}]': Attaches an existing MediaLive input to the channel using its ID.
- --role-arn "<IAM-role-arn>": Specifies the IAM role that grants MediaLive permission to access AWS resources.
- --destinations '[{"Id":"destination1","Settings":[{"Url":"rtmp://your-cloudfront-distribution-domain/app"}]}]': Defines the output destination for the stream, using an RTMP URL.
Start the MediaLive Channel
Starting a MediaLive channel activates the live video pipeline, enabling real-time processing and delivery of your content. Once your input and output are configured, launching the channel initiates encoding and begins streaming to your designated destinations. This step is crucial for going live with your broadcast.
Step 1: In the AWS MediaLive console, go to the Channels section.
Step 2: Select the channel you created and click Start.
Step 3: The channel will begin processing the video stream from OBS.
AWS CLI to Start the Channel
aws medialive start-channel --channel-id <channel-id>Explanation:
- aws medialive start-channel: Starts an existing AWS MediaLive channel to begin processing and broadcasting live video.
- --channel-id <channel-id>: Specifies the unique identifier of the MediaLive channel to start.
Monitor the Stream and Adjust Settings
Monitoring your stream and adjusting settings in real time is key to maintaining broadcast quality and viewer satisfaction. By tracking metrics like bitrate, resolution, and error rates, you can quickly identify and resolve issues. Fine-tuning settings ensures optimal performance across varying network conditions and audience demands.
- Stream Monitoring: Use the MediaLive Monitoring dashboard to track the health and status of the stream.
- Adjust Encoding: If you experience buffering or quality issues, adjust the bitrate and resolution in both OBS and AWS MediaLive.
End the Stream and Stop the Channel
Ending the stream and stopping the MediaLive channel ensures that your live broadcast concludes properly and resources are no longer in use. This step prevents unnecessary charges and allows you to make updates or prepare for your next event. It's a simple but essential part of managing your live streaming workflow.
Step 1: Go to the Channels section in AWS MediaLive.
Step 2: Select the active channel and click Stop.
AWS CLI to Stop the Channel
aws medialive stop-channel --channel-id <channel-id>Explanation:
- aws medialive stop-channel: Stops an active AWS MediaLive channel, halting live video processing and broadcasting.
- --channel-id <channel-id>: Specifies the unique identifier of the MediaLive channel to stop.

