Design a video sharing and streaming architecture that processes user uploaded raw videos into multiple resolutions (1080p, 720p, 4K) and delivers buffer-free playback to millions of concurrent viewers globally.
Measures network throughput in real time and requests optimal video chunk resolution using HLS manifest.
Caches transcoded video chunks close to end users, serving 95%+ of video traffic.
Issues direct S3 pre-signed URLs allowing clients to upload huge files directly to storage.
Stores original uploaded high-res video files before transcoding.
Distributes chunked encoding tasks across fleet of GPU/CPU workers.
Runs FFmpeg to split videos into 4-second chunks and transcode into H.264/VP9 at 1080p, 720p, 480p.
Stores video titles, descriptions, owner, thumbnail URLs, and index for search.
Request pre-signed upload URL for raw video.
Direct upload from client to S3 bucket in chunks.
Trigger processing message in SQS queue.
Generate master.m3u8 manifest and video_1080p_001.ts chunks.
Store output segments and purge raw S3 file if configured.
Stream video seamlessly with ABR buffering.