Skip to content
System Design Explorer

Comparison

YouTube vs Twitch: On-Demand Video vs Live Streaming

By Ankur NayakReviewed

YouTube and Twitch both turn a creator's video into many renditions and stream them to viewers who switch quality as their bandwidth changes. Both have published how the heavy part works: YouTube in a 2021 paper on its custom transcoding chip, Twitch in posts on its ingest network, transcoder and low-latency delivery.

The difference is time. YouTube processes an upload once and serves it for years, so it can split a video into chunks, transcode them in parallel and spend extra compute on popular videos. Twitch must transcode a stream as it happens and deliver it seconds later, so its engineering centres on routing each live stream to an origin with capacity and keeping latency low.

YouTube architecture diagramComponents: Creator, Upload Service, Video Work Scheduler, Transcoding (VCU (custom ASIC)), Cloud Storage, Metadata (Vitess) (MySQL), CDN, Google Global Cache, Viewer's Player. Connections: Creator to Upload Service (upload); Upload Service to Cloud Storage (original); Upload Service to Video Work Scheduler (processing graph); Upload Service to Metadata (Vitess) (title, channel); Video Work Scheduler to Transcoding (steps); Transcoding to Cloud Storage (variants); Cloud Storage to CDN (video files); CDN to Google Global Cache (fill); Google Global Cache to Viewer's Player (chunks); CDN to Viewer's Player (chunks).CreatorClientUpload ServiceAPI gatewayVideo Work SchedulerSchedulerTranscodingVCU (custom ASIC)Cloud StorageObject storageMetadata (Vitess)MySQLCDNCDNGoogle Global CacheCDNViewer's PlayerClient
Twitch architecture diagramComponents: Broadcaster (RTMP), PoP Media Proxy (Intelligest), Ingest Router (Intelligest), Origin Transcoding, Delivery PoPs, Viewer's Player (Low-latency HLS), Local ISPs, Hardware Transcoders. Connections: Broadcaster to PoP Media Proxy (live stream); PoP Media Proxy to Ingest Router (which origin?); PoP Media Proxy to Origin Transcoding (private backbone); Origin Transcoding to Delivery PoPs (backbone); Delivery PoPs to Viewer's Player (segments); Delivery PoPs to Local ISPs (partner networks); Origin Transcoding to Hardware Transcoders (renditions).BroadcasterRTMPPoP Media ProxyIntelligestIngest RouterIntelligestOrigin TranscodingWorkerDelivery PoPsCDNViewer's PlayerLow-latency HLSLocal ISPsExternal APIHardware TranscodersWorker

Side by side

YouTube compared with Twitch
DimensionYouTubeTwitch
InputUploaded files: 500+ hours a minute (2021)Live RTMP or WebRTC streams into ~100 PoPs
Where work is placedA global work queue of processing steps, usually near the uploaderA routing service picks an origin per stream from live capacity and backbone health
TranscodingChunks (closed GOPs) in parallel on custom VCU chips; decode once, encode all renditionsIn real time at origins with TwitchTranscoder and hardware transcoders; top rendition transmuxed
Using popularityPopular videos get extra compute for better compression; the long tail is kept cheapEvery live channel needs renditions now; hardware transcoding raised coverage 10x at 2x cost
DeliveryCloud storage → CDN (and caches inside ISPs)Origins → backbone → PoPs, partnering with local ISPs
Latency targetFast start and smooth playback; no live deadlineAbout 3 seconds glass to glass with low-latency HLS

Verdict

The two pipelines share the adaptive-bitrate skeleton but optimise different budgets. YouTube optimises cost over a video's lifetime: it can wait, parallelise and re-encode popular videos later. Twitch optimises time: every second of delay matters, so it routes streams in real time and transcodes as they arrive. In an interview, ask early whether the video is live or on-demand; most of the design follows from that answer.

Frequently asked questions

How is live streaming different from video on demand?

On-demand video can be processed after upload, in parallel and at leisure, then cached for years. Live video must be transcoded and delivered within seconds as it is produced, so capacity has to be found in real time and buffers kept small to limit delay.

Do YouTube and Twitch both use adaptive bitrate streaming?

Yes. Both encode each video into several renditions and let the player pick the one its bandwidth can sustain. YouTube's ladder runs from 144p to 4320p; Twitch's live renditions include 1080p60, 720p60, 720p30 and 480p30.

More comparisons