/aws-serverless-video-processor

A serverless video processing prototype, using containers on AWS Fargate.

Primary LanguagePowerShell

Objective

Perform video conversions using AWS Fargate, triggered by uploads to an Amazon S3 Bucket. Check out the video training content!

Architecture Diagram

Dependencies

Usage

  1. Clone repository
  2. Modify ./08-Final Project/cloudformation.yml to use unique S3 Bucket names
  3. Run ./08-Final Project/build/deploy.ps1
  4. Upload an MP4 video file into the "source bucket"

Learning Points

  • AWS CloudTrail must be enabled, with S3 data events, in order to trigger Amazon EventBridge rules
  • ECS Task Definitions must be marked as Fargate compatible, else invocation will fail
  • AWS Python cfn-lint is a helpful tool for validating CloudFormation templates
  • The $.input is the root object in AWS Step Functions. Use $.detail.requestParameters.key NOT $.input.detail....
  • Both PutObject and CompleteMultipartUpload API calls are used in S3 to trigger EventBridge rules

Customization Ideas

  • Build a drag-and-drop web front-end to perform conversions
  • Modify the ffmpeg parameters to support different encoding parameters
  • Use the Choice state in AWS Step Functions to branch logic based on parameters, such as file size or type
  • Add a step to the AWS Step Functions state machine to send a completion e-mail