← Lessons

quiz vs the machine

Gold1380

System Design

The YouTube Video Pipeline

Uploaded video is transcoded asynchronously into many formats before it can play.

5 min read · core · beat Gold to climb

Upload is only the start

A raw upload cannot play on every device. YouTube runs an asynchronous pipeline that transcodes each video into many resolutions and codecs, then publishes when ready.

Chunked transcoding

The video is split into segments that are transcoded in parallel across a fleet of workers. Splitting work this way turns a long serial encode into many short parallel jobs.

  • Upload lands in object storage
  • A queue dispatches transcode jobs per segment and resolution
  • Workers write renditions back to storage
  • The video flips to published once core renditions are ready

Decoupling with a queue

A message queue sits between upload and transcoding so spikes in uploads do not overwhelm workers. The uploader gets a fast response while encoding proceeds in the background.

The pipeline is asynchronous because encoding is slow and bursty, and the user should not wait for it.

Key idea

Decouple upload from transcoding with a queue, split each video into segments encoded in parallel, and publish once the core renditions are ready.

Check yourself

Answer to earn rating on the learn ladder.

1. Why is YouTube transcoding done asynchronously after upload?

2. Why split a video into segments before transcoding?