Amazon Live Streaming and CloudFront

The weekend that passed marked the première for me to use Amazon Web Services as a streaming solution for a live broadcast. No, don’t get me wrong, I’ve done it using EC2 before – several times – but in this case I had to use CloudFormation and because of that it was a première.

The setup is pretty straightforward.

So here we go using Amazons pre-configured CloudFormation template. During about 10-15 minutes it automates a setup of CloudFront distribution as well as the EC2 instance needed to serve it. Since this current client was estimating about 1000+ concurrent viewers and they where running 1,2 Mbit/s video stream – and Amazon has a 1Gbit/s limit – I had to contact Amazon and ask them to raise the limit to 2Gbit/s, a request they happily obliged.

The basic setup of how it works is included here. Since the only way of doing live streaming via cloudfront, as far as I know, is to use HTTP-live-streaming instead of standard RTMP-streaming this is of course what we used. Amazon has an excellent article describing exactly how to get it set up so it’s not what I would consider a case of “rocket science”.

So, how did it go. Well – we found a few minor bugs – these are the issues we found during our two broadcasts this weekend:

  1. Minor buffering and drops – after checking this seemed to be an issue with caching on the cloudfront (we’ve reported it to Amazon). When a package (part of the live stream) was missing in the cache on cloudfront the time it took to retrieve it from the server was long.
  2. The cache, default, is way too long. Amazon has a 24 hour period for caching, after last access, on CloudFront. This gave us weird problems since live streaming is live. When we stopped encoding and then restarted CloudFront started serving us old content. We resolved it by killing our CloudFormation and started a new instance, thus getting a new CloudFront hostname and an empty cache. (we’ve reported this to Amazon as well).

One minor, economic, issue is that the FMS has either a 1000 concurrent viewers limit or, the next, 10.000 concurrent viewers. Since we where expecting 1000+ we had to go with the 10.000 version. But, what I haven’t gotten a response to as of yet, it would seem that the server only had ONE connection during the broadcasting (CloudFront presumably).

That said, it is a problem that I have to discuss for our next broadcast. As well as getting the small buffering and drops out of the system if possible.

Conclusion: Using Amazon for Live Streaming is quite good – It isn’t free but you can get “global coverage” with only one EC2 instance by using CloudFront for distribution. So, in short, I can’t complain and it was easily set up and the people at Amazon that I’ve been in contact with have been more than helpful. (Thanks Brad).

Recommended Posts

No comment yet, add your voice below!

Add a Comment

Your email address will not be published. Required fields are marked *