Creating a scalable HLS live stream from an input feed using AWS Elemental(MediaLive)

Rahul Golwalkar
2 min readMar 1, 2020

--

This was a part of my previous job — AWS does provide great solutions that are customer-centric, however, it seems that they forgot to make a good UX for the basic requirement and was quite confusing initially however I figured it out and hope the tutorial helps.

Though I haven’t had the time to write a proper tutorial — hope the following video helps

I created this video as AWS Elemental, though powerful, has made it quite confusing to setup a simple HLS/dash live streaming from an input source. Once a stream is setup as an HLS video it is easy to scale it using a CDN In the tutorial above, I have used Open Broadcaster Software(OBS) to push a Live RTMP stream to Media Live, however, AWS supports multiple ways as well. Media Live converts the stream into HLS chunks which in turn pushes to MediaPackage which handles the packaging and provides the endpoint url. This is a basic implementation — it can be easily configured in multiple ways as per requirement. Please comment if you need any help with the steps.

Cost estimation

UPDATE: Many people were asking me for a cost estimation for the above setup. Here is a very rough sample calculation for a user base of 200 viewers watching a 2-hour long video

Well as always the answer completely depends on n number of factors — though here is a ballpark figure based on assumptions that I make as I calculate

Let’s say that we go with AVC(h.264) at 30 FPS — for 1080p the industry recommended bit rate is 8 Mbps

Assuming that all users are with good connectivity and watching at 1080p

We have 8Mbps x (2 hours x 3600 secs) x 200 viewers = approx. 11520 Gb = 1440 GB

Assuming AWS CF pricing approx. at $0.085 / GB we get total data cost at 1440 x 0.085 = $122

$122 for data transfer from CDN on the higher end — this will increase as your the user count increases

Media live and other miscellaneous costs actually depend on the configuration goes … that shouldn’t be more than $50 for a 2-hour stream

Total = $172

All in all, it can be easily capped under $200 — in my experience, the actual costs that you need to worry are the data costs rather than the transcoding — well it is, of course, subject to the business goals as well.

--

--