Video on Demand on AWS
Video on Demand on AWS

Architecture Overview

Deploying this solution with the default parameters builds the following environment in the AWS Cloud.

        Video on demand solution architectural overview

Figure 1: Video on Demand architecture on AWS

The AWS CloudFormation template deploys a workflow that includes Amazon Elastic Transcoder and AWS Step Functions, which creates ingest, processing, and publishing step functions. It also launches AWS Lambda functions that trigger the ingest and publishing processes, Amazon S3 buckets for source and destination media files, Amazon CloudWatch for logging, and an Amazon CloudFront distribution. An Amazon DynamoDB table stores metadata on the media files, and Amazon SNS topics send encoding, publishing, and error notifications.

Ingest Workflow

When a new MP4, MPG, M4V, or MOV video is added to the source Amazon S3 bucket, a Lambda function triggers the ingest workflow. During ingestion, source video details are added to Amazon DynamoDB, the content is validated using MediaInfo, open-source software that displays technical information about media files, and details are stored in DynamoDB, an encoding profile is set and used to start encoding the video. Amazon SNS sends a notification with the source encoding and content details. For more information on the ingestion process, see Appendix A.


Source video file extensions (.mp4, .mpg, .m4v, or .mov) must be lowercase and file names cannot contain spaces.

Processing Workflow

Two encoding jobs are created in Amazon Elastic Transcoder, one that creates a standalone MP4 and one that creates HTTP Live Streaming (HLS) manifests and segments. The encoding jobs use one of the seven included transcoding presets for these formats. You can also create your own custom presets based on an existing preset. For more information, see Encoding Presets.

Publishing Workflow

After the video is encoded, Elastic Transcoder sends a notification to Amazon SNS which invokes another AWS Lambda function that starts the publishing workflow. The publishing step functions determine which encoding job has finished, MP4 or HLS, invoke the appropriate Lambda function, and update the DynamoDB table with the new content details.

The MP4 output is validated and a metadata file is created and stored with the MP4 output file in Amazon S3. For HLS output, the output details are used to create an Amazon CloudFront URL for the master manifest file. When the encoded MP4 and HLS content is complete, a summary of the source and destination files is sent to Amazon SNS. For more information on the publishing process, see Appendix B.