Back to Case Studies
Video Encoding

Serverless Video Processing Pipeline with AWS MediaConvert

The video platform needed a scalable, cost-effective way to handle variable encoding workloads, from quiet periods with few uploads to peak times with hundreds of simultaneous jobs.

Discuss Your Project
serverless-video-processing.webp
Video Encoding
Domain
9
Technologies
4
Key Results
Delivered
Status

The Challenge

Fixed-capacity encoding infrastructure was either over-provisioned (costly) or under-provisioned (slow):

  • Encoding workloads were highly variable and unpredictable
  • Peak periods could see 100x normal volume during content launches
  • Running dedicated encoding servers 24/7 was expensive during quiet periods
  • Job failures needed automatic detection and retry without manual intervention

Our Solution

We implemented a serverless encoding pipeline using AWS Lambda triggers and AWS MediaConvert for elastic, pay-per-use video processing.

Architecture

  • Trigger: AWS Lambda function monitoring S3 upload events
  • Encoding: AWS MediaConvert with partner-specific job templates
  • Messaging: ActiveMQ/STOMP for asynchronous job status updates
  • Monitoring: NestJS encoder backend tracking job progress
  • Storage: AWS S3 for input/output assets

Pipeline Flow

  1. S3 Event - Video upload triggers Lambda function
  2. Job Configuration - Lambda reads partner profile and constructs MediaConvert job
  3. Submission - MediaConvert job submitted with appropriate output settings
  4. Progress Tracking - STOMP messages relay status to encoder backend
  5. Completion - Output assets stored in S3, metadata updated in MongoDB
  6. Error Handling - Failed jobs queued for retry with exponential backoff

Key Features

  1. Zero Idle Cost - Lambda and MediaConvert charge only for actual usage
  2. Elastic Scaling - Handles 1 to 1000+ concurrent encoding jobs
  3. Partner Templates - Pre-configured MediaConvert job templates per partner
  4. Event-Driven - S3 events automatically trigger encoding workflows
  5. Comprehensive Monitoring - Job status, duration, and error tracking

Results

Cost Reduction: 60% reduction compared to always-on encoding servers
Scale: Handled 100x traffic spikes without infrastructure changes
Reliability: Automatic retry with error classification maintained 99.5% success rate
Speed: Parallel MediaConvert jobs processed content faster than sequential encoding

Technology Stack

AWS LambdaAWS MediaConvertAWS S3NestJSTypeScriptMongoDBActiveMQSTOMPFFmpeg

Frequently Asked Questions

MicrocosmWorks designed a segmented processing architecture where Step Functions orchestrate the pipeline: Lambda functions split source videos into segments, AWS MediaConvert handles the actual transcoding without Lambda timeout constraints, and a final Lambda stitches the output. This hybrid approach keeps the serverless cost model while supporting videos of any duration.

MicrocosmWorks measured a 70-85% cost reduction for bursty video processing workloads compared to running dedicated EC2 encoding instances. The serverless pipeline incurs zero cost when idle and scales to hundreds of concurrent jobs during peak periods, with AWS MediaConvert's per-minute pricing eliminating the need to provision for peak capacity.

MicrocosmWorks configured AWS Step Functions with per-step retry policies and exponential backoff, ensuring that a failed transcode step retries automatically without restarting the entire pipeline. Each stage writes intermediate outputs to S3, so recovery resumes from the last successful checkpoint rather than reprocessing from the source file.

MicrocosmWorks optimized the pipeline for near-real-time use cases with cold start mitigation using provisioned concurrency on critical Lambda functions and MediaConvert reserved transcoding slots. For live workflows, the pipeline achieves 2-5 minute end-to-end latency from upload to delivery, which is suitable for clip extraction and highlights distribution.

MicrocosmWorks builds serverless video infrastructure at rates of $25-$45/hr, with a complete MediaConvert-based pipeline including Step Functions orchestration, S3 lifecycle management, and monitoring typically requiring 250-400 development hours. The architecture's pay-per-use model means clients only pay AWS costs proportional to their actual processing volume.

Have a Similar Project in Mind?

Let's discuss how we can build a solution tailored to your needs.

Contact UsSchedule Appointment