Requirements
- Let creators upload video and viewers stream it smoothly.
- Adapt quality to the viewer network speed.
- Serve global audiences with low buffering.
High level design
Uploads are stored, transcoded into multiple bitrates, segmented, and served from edge caches.
- Ingest and store: an upload lands in object storage as the raw source.
- Transcoding pipeline: workers encode the video into several resolutions and split each into small segments.
- Delivery: a CDN caches segments near viewers, and players fetch a manifest then pull segments adaptively.
Bottlenecks
- Transcoding cost: encoding many renditions is expensive, so parallelize across workers and process segments independently.
- Startup latency: viewers want instant play, so prefetch the first segments and start at a low bitrate.
- Adaptive switching: networks vary, so the player measures throughput and switches renditions per segment.
Manifests list the available bitrates and segment URLs so the player can climb to higher quality when bandwidth allows.
Key idea
A streaming service transcodes uploads into segmented multi bitrate renditions delivered from a CDN, letting players adapt quality segment by segment.