Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Build a Live Streaming Platform with AWS Elemental Link

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide walks you through building a live streaming platform using AWS Elemental Link, a hardware device that encodes video and sends it to AWS Media Services for distribution. By the end, you'll have a scalable live stream viewable on websites or apps, with minimal latency and high reliability. You'll need an AWS account, an Elemental Link device, and basic familiarity with the AWS Management Console.

What You'll Need

  • An AWS account with administrative access (or permissions for MediaLive, S3, CloudFront, and IAM).
  • AWS Elemental Link device (e.g., Link UHD or Link HD) with power and network connection.
  • A video source (camera, encoder, or screen capture) that outputs via HDMI or SDI.
  • A computer to access the AWS Management Console.
  • Optional: a domain name for a custom playback URL.

Step-by-Step

  1. Set up the Elemental Link hardware. Connect the device to your network via Ethernet, attach your video source (HDMI or SDI), and power it on. Wait for the device to boot; the front panel LED indicates network connectivity.
  2. Register the device in AWS. In the AWS Management Console, navigate to AWS Elemental MediaLive. Under "Devices," choose "Register device." Enter the device's serial number (found on the bottom label) and follow the prompts. The device will appear as "Registered" once connected.
  3. Create an IAM role for MediaLive. Go to IAM, create a role with the following permissions: MediaLiveRole (or use the managed policy MediaLiveAccessRole). Attach policies for S3 (for output storage) and CloudFront (if you plan to use it). Note the role ARN.
  4. Create an S3 bucket for outputs. In S3, create a bucket (e.g., my-live-stream-output). Enable versioning if desired, but keep it simple. This bucket will store HLS segments or MP4 files for on-demand viewing.
  5. Set up a CloudFront distribution (optional but recommended). In CloudFront, create a distribution with the S3 bucket as origin. Configure a signed URL or restrict access if you want private streaming. For public streams, leave it open. Note the distribution domain name (e.g., d123.cloudfront.net).
  6. Create a MediaLive channel. In MediaLive, choose "Create channel." Under "Input attachments," select your Elemental Link device as the input. Configure the input as "RTMP" or "RTP" depending on your device model; the device automatically sends the stream.
  7. Configure the channel output. Add an output group for HLS (for adaptive bitrate) or a single MP4 output. For HLS, set the output destination to the S3 bucket path (e.g., s3://my-live-stream-output/live/). Choose a codec (H.264 for video, AAC for audio). Set bitrates based on your source quality (e.g., 1080p at 5 Mbps).
  8. Start the channel. After saving the channel, click "Start." MediaLive will begin pulling the stream from the Elemental Link. Wait a few minutes for the channel to go live; the status changes from "Creating" to "Running."
  9. Test the stream. Use a media player like VLC or a web player (e.g., HLS.js) to open the playback URL. For HLS, the URL will be something like https://d123.cloudfront.net/live/index.m3u8. If using S3 directly, use the S3 URL but note it may not be publicly accessible.
  10. Monitor and manage. Use CloudWatch metrics to check for errors, dropped frames, or bandwidth issues. You can also set up alarms for stream health. Stop the channel when not in use to avoid costs.

Common Mistakes

  • Incorrect IAM role permissions. If MediaLive can't write to S3 or read the device, the channel fails to start. Double-check the role has s3:PutObject and s3:ListBucket permissions.
  • Wrong input type. Elemental Link devices output in specific protocols. If you select the wrong input type in MediaLive, the channel won't receive video. Check the device model documentation.
  • Network bandwidth issues. Streaming high bitrate video requires stable upload. If your internet is slow, the stream may buffer or drop. Use a wired connection and ensure sufficient upload speed (at least 1.5x the bitrate).
  • Forgetting to start the channel. Creating a channel doesn't start it. You must manually start it each time you want to stream.
  • CloudFront origin misconfiguration. If using CloudFront, ensure the origin is the S3 bucket and the default root object is set to the HLS playlist (e.g., index.m3u8).

Tips

  • Use adaptive bitrate streaming (HLS). This adjusts quality based on viewer bandwidth, improving experience. MediaLive can output multiple renditions (e.g., 1080p, 720p, 480p) with a single channel.
  • Enable AWS Elemental MediaStore instead of S3 for low latency. MediaStore is designed for live media and offers lower latency than S3. It's a drop-in replacement for S3 in the output destination.
  • Set up CloudFront with signed URLs for secure streaming. This prevents unauthorized access to your stream.
  • Use AWS Elemental MediaPackage for additional features. MediaPackage can add DASH support, DRM, and time-shift viewing. It sits between MediaLive and CloudFront.
  • Schedule streams. Use AWS EventBridge to start/stop the channel automatically for scheduled events, saving costs.
  • Test with a short stream first. Before a live event, do a test run to verify all components work, including video quality and latency.

Troubleshooting

  • Channel fails to start. Check the channel's error messages in the "Alerts" tab. Common causes: IAM role issues, input not connected, or invalid output destination. Verify the IAM role ARN is correct and the S3 bucket exists.
  • No video in the player. First, check if the channel is running. Then, open the HLS URL in a browser or VLC. If it doesn't play, verify the S3 bucket is public or CloudFront is properly configured. Use the CloudFront URL, not the S3 URL, for public access.
  • High latency. Reduce latency by using a shorter GOP (group of pictures) in the encoder settings (e.g., 1 second instead of 2). Also, use MediaStore instead of S3 for output.
  • Stream drops intermittently. Check network stability. Use a wired connection and ensure your ISP doesn't throttle upload. Also, check the Elemental Link's status LEDs for errors.
  • Audio out of sync. Ensure audio and video are both encoded in the same container. In MediaLive, set the audio and video codecs to the same frame rate and sample rate as the source.
  • Device not registering. Confirm the device is powered on and connected to the internet. Try a factory reset (press and hold the reset button for 10 seconds).

Frequently Asked Questions

What is AWS Elemental Link?

AWS Elemental Link is a hardware device that encodes live video and sends it to AWS Media Services for processing and distribution. It simplifies the setup by handling encoding on-site.

Can I use Elemental Link without AWS MediaLive?

No, Elemental Link is designed to work with MediaLive. It sends the encoded stream to MediaLive, which then processes it for output.

How much does it cost to run a live stream on AWS?

Costs vary based on the device, MediaLive channel hours, S3 storage, and data transfer. You pay for the device upfront and then for AWS services used. Use the AWS Pricing Calculator for estimates.

Can I stream to YouTube or Facebook using Elemental Link?

Yes, you can configure MediaLive to output an RTMP stream to YouTube or Facebook. Create an output group with RTMP protocol and enter the platform's stream URL and key.

How do I make my stream private?

Use CloudFront with signed URLs, or use MediaPackage with DRM. You can also restrict S3 bucket access and use CloudFront origin access control.

What internet speed do I need?

For 1080p at 5 Mbps, you need at least 7 Mbps upload. For 4K, you'll need 20+ Mbps. Always have a buffer of 1.5x the bitrate.