Skip to content
Shakthivel Arumugam

Event-Driven Streaming Video Processing Platform

An event-driven HLS pipeline on AWS that processes over 1,000 daily uploads with zero message loss.

Stack
  • AWS ECS
  • ECR
  • EC2
  • SQS
  • S3
  • Python

Problem

Uploaded videos had to become streaming-ready HLS output reliably, and upload volume could jump well above normal without any upload being lost.

Approach

Each upload produces an event. SQS buffers the events and EC2 consumers pick them up, so processing runs asynchronously and a traffic spike queues work instead of dropping it. FFmpeg encoding runs in containers on ECS, and the HLS output is written to S3.

Video processing pipelineAn upload becomes an event in an Amazon SQS queue. EC2 consumers pull work from the queue. FFmpeg encoding runs as containers on Amazon ECS, and the HLS output is written to Amazon S3.UploadA video arrivesAmazon SQSBuffers events, so spikes queue upEC2 consumersPull work from the queueFFmpeg on Amazon ECSContainerized encoding, images in ECRAmazon S3HLS output, ready to stream
Simplified flow of the pipeline, from upload to streaming-ready output.

Key decisions and trade-offs

  • A queue between upload and processing. SQS decouples the two, so a traffic spike lengthens the queue instead of overloading the encoders or losing an upload. The cost is that processing is asynchronous: a video is not streamable the moment it is uploaded, and the wait grows with queue depth.
  • Two kinds of compute. EC2 consumers pull work from the queue, and FFmpeg encoding runs as containers on ECS. Containerizing the encoder cut processing time by 60%. The cost is operating two compute layers, each with its own images, permissions and scaling.
  • HLS output in S3. Segmenting video into HLS leaves streaming-ready files in S3 that standard players can fetch directly, with no media server to run. The cost is encoding work up front, and many small files per video instead of one.

Results

  • The pipeline processes over 1,000 uploads a day with zero message loss.
  • It absorbed 10x traffic spikes with about 99% processing reliability.
  • Containerizing FFmpeg on ECS cut processing time by 60%.