# Design a Video Streaming Platform (YouTube, Hotstar)

> Design upload, transcoding, adaptive bitrate streaming and CDN delivery, including live events with crores of concurrent viewers. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/system-design/case-video-streaming
Last updated: 2026-11-28

Design upload, transcoding, adaptive bitrate streaming and CDN delivery, including live events with crores of concurrent viewers.

Advanced · about 5 hours · difficulty 4/5

Learn first: [Object Storage and Large Files](https://www.internhack.in/roadmaps/tracks/system-design/object-storage), [Content Delivery Networks (CDNs)](https://www.internhack.in/roadmaps/tracks/system-design/cdn), [Message Queues and Async Processing](https://www.internhack.in/roadmaps/tracks/system-design/message-queues)

Disney+ Hotstar has served live cricket to more than 5 crore concurrent viewers. Video systems are mostly about moving huge bytes efficiently, and the CDN does most of the work.

### Requirements

- Upload videos (creator side), process them, and stream to any device on any network.
- Smooth playback on 3G to fibre; start fast; low rebuffering.
- For live: low delay and massive, spiky concurrency at match moments.
- Metadata, search, recommendations, view counts.

### Upload and processing (VOD)

1. Client uploads to object storage using **resumable multipart uploads** via pre-signed URLs.
2. An upload event triggers a **transcoding pipeline** (a DAG of jobs on a queue): split into chunks, transcode each chunk in parallel into multiple **resolutions and bitrates** (240p to 4K) and codecs (H.264, H.265, AV1), generate thumbnails, run checks.
3. Output is packaged into small **segments** (2 to 6 seconds) with manifests for **HLS** and **DASH**.

### Playback

The player downloads the manifest, then fetches segments, switching quality per segment based on measured bandwidth: **adaptive bitrate streaming (ABR)**. Segments are static files, perfect for **CDNs**; popular content is pre-positioned at edges (Netflix even places servers inside ISPs).

### Live streaming

Ingest from the stadium encoder (RTMP or SRT), transcode in real time into ABR ladders, package into short segments, push to CDNs. Trade-off: shorter segments mean lower latency but more requests and overhead. At peak, the hard problems are **CDN capacity**, origin shielding, pre-scaling ahead of predicted spikes (toss, last overs) and degrading gracefully (cap the max bitrate for everyone instead of failing).

### Other pieces

Metadata in a relational or document DB, view counts aggregated via a stream (approximate is fine), watch history in a wide-column store, DRM for premium content.

### Pitfalls

- Serving video from your app servers instead of CDN and object storage.
- Transcoding an entire 2-hour file on one machine.
- Autoscaling reactively for live events; you must pre-scale.

You are ready to move on when you can trace a video from upload to a viewer's screen on a weak 4G connection, and explain how live cricket survives a 3x spike in a minute.

## Key concepts

- **Resumable uploads**
- **Transcoding pipeline as a DAG**
- **Segments and manifests (HLS, DASH)**
- **Adaptive bitrate streaming**
- **CDN delivery and pre-positioning**
- **Live ingest and low latency**
- **Pre-scaling for live events**
- **DRM**

## Mini project

Use ffmpeg to transcode a video into a 3-rung HLS ladder (360p, 720p, 1080p), serve it from object storage or a static server behind a CDN, and play it with hls.js while throttling bandwidth in DevTools to watch quality switch. Write up the pipeline design.

## Check yourself

Why does adaptive bitrate streaming split video into short segments, and what is the trade-off of making live segments even shorter?

## Free resources

- [HTTP Live Streaming](https://developer.apple.com/streaming/) (Apple)
- [Netflix Tech Blog](https://netflixtechblog.com/) (Netflix)
- [Disney+ Hotstar tech blog](https://blog.hotstar.com/) (Hotstar)
- [FFmpeg documentation](https://ffmpeg.org/documentation.html) (FFmpeg)

Previous: [Design a News Feed (Instagram, Twitter, LinkedIn)](https://www.internhack.in/roadmaps/tracks/system-design/case-news-feed) · Next: [Design Ride Matching (Uber, Ola, Rapido)](https://www.internhack.in/roadmaps/tracks/system-design/case-ride-matching)

## More in HLD Case Studies: Large Products

- [Design a Chat App (WhatsApp)](https://www.internhack.in/roadmaps/tracks/system-design/case-chat-app)
- [Design a News Feed (Instagram, Twitter, LinkedIn)](https://www.internhack.in/roadmaps/tracks/system-design/case-news-feed)
- [Design a Video Streaming Platform (YouTube, Hotstar)](https://www.internhack.in/roadmaps/tracks/system-design/case-video-streaming)
- [Design Ride Matching (Uber, Ola, Rapido)](https://www.internhack.in/roadmaps/tracks/system-design/case-ride-matching)
- [Design a Payment System (UPI-style)](https://www.internhack.in/roadmaps/tracks/system-design/case-payments-upi)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [System Design Roadmap](https://www.internhack.in/roadmaps/tracks/system-design)
