Skip to content

Reference architecture

Serverless video transcoding and HLS streaming pipeline

A cost-efficient transcoding pipeline that turns user uploads into adaptive HLS streams for global delivery.

Design constraints

What the design has to hold to

Targets for the scenario this reference is sized for. A real engagement starts by replacing them with your own numbers.

  • 01Adaptive bitrate (ABR) streaming at 4K, 1080p, 720p and 480p
  • 02Direct browser-to-S3 multipart uploads, never proxied through application servers
  • 03Automated thumbnails and audio loudness normalization (EBU R128)
  • 04Signed, expiring playback URLs that stop hotlinking

Component topology

System components and technologies

Subsystems with separate responsibilities, clear contracts between them and storage that scales on its own. The stack named for each is typical, not mandatory.

Stack topology

Serverless video transcoding and HLS streaming pipeline

Illustrative reference architecture

  1. 01

    Upload accelerator

    Presigned multipart S3 upload URLs and progress tracking

    Next.js Server Actions + S3

  2. 02

    Transcoding engine

    HLS adaptive bitrate packaging with H.264/H.265 encoding

    AWS Elemental MediaConvert

  3. 03

    Metadata database

    Video metadata, duration, playback URLs and processing state

    PostgreSQL + Prisma

  4. 04

    Global video CDN

    Low-latency segment delivery with signed-cookie checks

    Amazon CloudFront

Subsystem 01

Upload accelerator

Presigned multipart S3 upload URLs and progress tracking

Typical stack

Next.js Server Actions + S3

Subsystem 02

Transcoding engine

HLS adaptive bitrate packaging with H.264/H.265 encoding

Typical stack

AWS Elemental MediaConvert

Subsystem 03

Metadata database

Video metadata, duration, playback URLs and processing state

Typical stack

PostgreSQL + Prisma

Subsystem 04

Global video CDN

Low-latency segment delivery with signed-cookie checks

Typical stack

Amazon CloudFront

Data lifecycle

End-to-end data flow

  1. The client requests a presigned upload URL and uploads the raw MP4 straight to the S3 ingest bucket.

  2. S3 emits an ObjectCreated event to Amazon EventBridge, which triggers a Lambda job dispatcher.

  3. The Lambda creates a MediaConvert job with an HLS ABR ladder (1080p, 720p, 480p) and thumbnail tracks.

  4. MediaConvert encodes the segments and writes HLS playlists (.m3u8) and segments to the delivery bucket.

  5. MediaConvert's job-complete event (via EventBridge) updates PostgreSQL, and the video becomes playable through CloudFront.

Reliability and resilience

Failure modes and how each is contained

Failure mode 01

Corrupt or unsupported codec uploads

Mitigation

Validate each upload with FFprobe before starting a MediaConvert job.

Failure mode 02

High CloudFront egress costs

Mitigation

Use QVBR (quality-defined variable bitrate) encoding, which spends bits only where the picture needs them.

Failure mode 03

Unauthorized redistribution

Mitigation

CloudFront signed URLs plus HLS AES-128 segment encryption, with key delivery behind authentication.

Questions

What teams ask about this design

HLS switches between quality levels as the viewer's connection changes, which avoids most buffering on slow mobile networks.

MediaConvert bills per minute of output, at rates that vary with resolution, codec, frame rate and pricing tier; check the AWS pricing page for your region. For uneven upload volume it usually costs less than keeping encoding servers idle.

Planning a system like this?

Send us your requirements, expected load and budget. We'll reply within one business day with an honest read on the design, and on whether we're the right team to build it.