Amazon CloudFront to stream videos to various devices. As you may know, video streaming can be implemented using a wide variety of protocols that are layered on top of HTTP. As is the case with just about every aspect of AWS, we do our best to provide our customers with more than one option, and video streaming is certainly no exception.

In this post I would like to show you how multiple AWS services, combined with some third-party software, can be used to implement two different types of video streaming. First we will take a look at on-demand streaming of content stored in Amazon S3. After that, we’ll examine live streaming of events.

On-Demand Streaming
In the on-demand streaming case, your video content is stored in S3. Your viewers can choose to watch it at any desired time, hence the name on-demand. A complete on-demand streaming solution typically makes use of Amazon S3 for storage, the Amazon Elastic Transcoder for video processing, and Amazon CloudFront for delivery.

Amazon S3 is an excellent storage facility for your video assets. It is infinitely scalable, has built-in redundancy, and is available to you on a pay-as-you-go basis. In other words, your storage costs will start out very low, and then rise in proportion to the amount of video that you store. You can read about Amazon S3 pricing to learn more. You can upload your content to S3 in a number of different ways. You can start by using the AWS Management Console when your volume is low, and then move to a more automated system as your volume increases. It is very easy to use S3 from the console. After you create your AWS account, you simply log in, create an S3 bucket, and then upload your content. If you want to implement an automated system, you can use the AWS Command Line Interface in your own scripts or the Amazon S3 APIs in your own code.

Once uploaded, you may need to convert your video into the size, resolution, or format needed by a particular video player or mobile device. The Amazon Elastic Transcoder will take care of this for you. The Elastic Transcoder takes content from one S3 bucket, transcodes it per your request, and stores the result in a second S3 bucket. Again, you can manage this process from the AWS Management Console,  the command line, or via the Elastic Transcoder APIs. You will need to learn a little bit about pipelines, jobs, and presets in order to make effective use of the Elastic Transcoder.

With your content safely stored and available in the formats required by your users, the next step is global delivery. This is a job for Amazon CloudFront. This service gives you scalable global delivery at a low price point. Because CloudFront caches content at the edges, your customers will experience uninterrupted video playback with minimal delays due to buffering. CloudFront’s scalability means that you can serve up as much or as little video as you want. You can handle unexpected spikes in demand with ease, again on a pay-as-you-go basis (see the CloudFront pricing to learn more). You will need to learn about CloudFront distributions as part of this step.