How YouTube Handles Video Streaming
- Author
- Prathamesh Patil
- Length
- 3120 words
- Read
- 14 min
YouTube video streaming looks simple from the viewer's side: press play and the picture adapts to your screen and connection. Behind that button is a pipeline that turns one uploaded file (or one live encoder feed) into many encoded versions, moves those bytes into caches that sit inside internet providers' networks, and lets the player switch between versions every few seconds. This teardown follows that path using what YouTube and Google have published: the YouTube engineering blog, the ASPLOS 2021 paper on Google's video transcoding chip, YouTube's encoder and playback help pages, and the Google Global Cache documentation. Where YouTube has not published an internal detail, the article says so instead of guessing.
Key takeaways
One input, many outputs. Every video is uploaded in a single format but has to play on phones, browsers, and 4K TVs, so YouTube transcodes it into many resolution and codec combinations before most people watch it.
Transcoding is the expensive step, so YouTube built a chip for it. The Video (trans)Coding Unit (VCU) delivered 20-33x better compute efficiency than YouTube's previous optimized software system, according to YouTube and the ASPLOS paper.
Better codecs cost more to encode. YouTube says VP9 needs about 5x more compute to encode than H.264, which is the economic reason a hardware encoder made sense. AV1 was the next codec planned for the chip.
Live streams enter through four ingest protocols. RTMP and RTMPS suit low-latency streams; HLS and DASH ingest are segment-based, add latency, and unlock HEVC or VP9 for 4K and HDR.
Delivery happens as close to the viewer as possible. Google Global Cache places Google-operated cache servers inside ISP networks; Google says 70-90% of cacheable traffic is typically served from these nodes.
The player decides quality per viewer. Auto quality reacts to connection speed, player size, source quality, and browser codec support. For live streams, latency is a trade against buffer.
Research basis
This teardown uses nine public sources from YouTube and Google: the YouTube engineering blog interview about the Video Coding Unit, the abstract of the ASPLOS paper on Google Research, four YouTube Help pages (upload encoding, live encoder settings, live latency, and playback quality), two YouTube Live Streaming API guides (ingestion protocols and HLS ingestion), and Google's introduction to Google Global Cache for ISPs. YouTube does not publish its internal storage system, its exact bitrate ladder, or how it routes a playback request to a specific cache, so those parts are marked as unknown rather than filled in.
How YouTube video streaming works: a 60-second overview
A creator either uploads a finished file or points a live encoder at YouTube's ingest endpoints. YouTube's transcoding fleet converts that source into a set of renditions: the same video at several resolutions and in several codecs. The renditions travel across Google's network to edge caches, including Google Global Cache (GGC) nodes hosted inside internet service providers. The viewer's player requests the version that fits its screen and current bandwidth and keeps re-evaluating that choice while the video plays.

The rest of the article walks each hop: what YouTube accepts at upload, how live ingest works, how the VCU changed transcoding, how GGC moves delivery into ISPs, and how the player trades quality against buffering.
Why the obvious design breaks: one upload, every screen
The naive design is to store the uploaded file and stream it to whoever asks. That fails for three reasons YouTube describes directly.
First, devices differ. As YouTube engineer Jeff Calow put it on the YouTube blog, video "is created and uploaded in a single format, but will ultimately be consumed on different devices - from your phone to your TV - at different resolutions." A 4K source file sent to a phone on a bus wastes bandwidth and will stall.
Second, volume. The same post says more than 500 hours of video are uploaded to YouTube every minute on average. Every one of those hours needs a full set of encoded versions.
Third, codec economics. YouTube moved toward more data-efficient codecs because, in its words, the broader internet "wouldn't be able to accommodate" demand for 1080p, 4K and 8K otherwise. But efficiency at playback is paid for at encode time: the blog's side-by-side comparison notes that VP9 looks clearly better than H.264 at the same size while using 5x more compute to encode.
Multiply those together (hundreds of hours per minute, several resolutions each, more than one codec, and the most efficient codec being the most expensive to produce) and transcoding becomes the dominant cost in the system. That is why the most interesting engineering in YouTube's public record sits in the transcoding layer rather than the web front end.
Upload path: what YouTube accepts and normalizes
YouTube's recommended upload settings tell you what the transcoder wants as input. The help page asks for an MP4 container with the moov atom at the front of the file (fast start) and no edit lists, H.264 High Profile with progressive scan, closed GOPs of half the frame rate, CABAC entropy coding, 4:2:0 chroma subsampling, and variable bitrate. Audio should be AAC-LC, Opus or Eclipsa Audio at 48 kHz.
Two details show how YouTube normalizes inputs before encoding:
Frame rate is preserved, interlacing is not. Content should be uploaded at the frame rate it was recorded, but interlaced content should be deinterlaced first (1080i60 becomes 1080p30).
Colour is standardized. YouTube unifies functionally similar colour settings (for example, BT.601 and BT.709 transfer characteristics are identical, so they are unified to BT.709), assumes BT.709 when tags are missing, and converts unsupported colour spaces to BT.709. Full-range colour is converted to limited range.
The recommended SDR upload bitrates make the size of the input concrete:
| Resolution | Standard frame rate (24-30) | High frame rate (48-60) |
|---|---|---|
| 2160p (4K) | 35-45 Mbps | 53-68 Mbps |
| 1440p | 16 Mbps | 24 Mbps |
| 1080p | 8 Mbps | 12 Mbps |
| 720p | 5 Mbps | 7.5 Mbps |
| 480p | 2.5 Mbps | 4 Mbps |
These are input recommendations, not what viewers receive. The page also notes that new 4K uploads are viewed in 4K only on browsers or devices that support VP9, which is the first hint that the output side is a different set of files from the input.
Live ingestion: RTMP, RTMPS, HLS and DASH
Live streams cannot wait for a finished file, so YouTube exposes ingest endpoints that encoders push to continuously. The YouTube Live Streaming API documents four protocols:
| Protocol | Encrypted | Video codecs | Fit |
|---|---|---|---|
| RTMP | No | H.264 | Normal, low, or ultra-low latency |
| RTMPS | Yes | H.264 | Normal, low, or ultra-low latency |
| HLS | Yes | H.264, HEVC | 4K and HDR; not for ultra-low latency |
| DASH | Yes | H.264, VP9 | 4K; not for ultra-low latency |
The split is a latency-versus-quality decision. HLS and DASH ingest are segment-based, so they "typically incur greater latency than RTMP," but they carry codecs that compress better than H.264, which lets a creator stream higher quality at the same bitrate or the same quality at a lower one.
The HLS ingestion guide shows the mechanics. The encoder sends Media Playlists and Media Segments to YouTube using HTTP PUT or POST, and YouTube's endpoint behaves like a passive HTTP server. Each segment covers between one and four seconds, video and audio are muxed in M2TS, and only closed GOPs are accepted. For redundancy, the encoder can send a second copy of the same stream to a backup host with a different copy= value.

The backup must use a different copy= value "to avoid corrupting the stream," which tells you YouTube treats the two feeds as distinct copies of one stream rather than two streams. How YouTube chooses between them internally is not documented.
YouTube's live encoder page adds the settings that make segments line up cleanly: keyframes every 2 seconds (never more than 4), constant bitrate, and H.264, HEVC or AV1 video. Recommended bitrates depend on codec; for 1080p at 60 fps, YouTube recommends 12 Mbps for AV1 or HEVC and 17 Mbps for H.264. The same page states the key behaviour on YouTube's side: it will "automatically transcode your live stream to create many different output formats so that all of your viewers across many devices and networks can watch."
Transcoding at warehouse scale: the Video Coding Unit
Transcoding is where YouTube published its deepest architectural detail. In 2021, YouTube and Google described the Video (trans)Coding Unit at the ASPLOS conference in the paper "Warehouse-Scale Video Acceleration: Co-design and Deployment in the Wild."
Why YouTube built hardware
The project started in 2015. The blog describes the problem plainly: transcoding on general-purpose CPUs "is pretty inefficient, especially as you add more and more videos," and the move to VP9 made each encode several times more expensive. Google already used dedicated chips for graphics (GPUs) and machine learning (TPUs); the VCU applies the same idea to video.
The VCU is more than a chip. YouTube describes "a custom chip to transcode video, as well as software to coordinate these chips." The paper's abstract stresses this co-design: balancing the system at data center scale and designing the accelerator together with the large-scale distributed software that schedules work onto it.
What it changed
Both sources report 20-33x better compute efficiency than YouTube's prior, well-tuned software system running on traditional servers. The paper adds two operational benefits beyond raw efficiency: the design "enables effective adaptation to changing bottlenecks and improved failure management," along with new workload capabilities that were not possible before.
YouTube credits the system with absorbing the pandemic surge. In the first quarter of the pandemic, watch time rose 25 percent worldwide, and total daily livestreams grew 45 percent over the first half of that year. Because the VCU fleet was in place, YouTube says it scaled up so that videos were available to viewers promptly after upload.

The diagram shows the shape of the work, not YouTube's exact pipeline: one source, several resolutions, several codecs, one set of outputs the player can choose from. YouTube has not published its exact bitrate ladder or the scheduling rules that place jobs on VCUs.
The trade-off YouTube accepted
The blog is candid that hardware "is a long-term commitment." A chip that comes back wrong means another manufacturing cycle and a long delay, so the team simulated the hardware in software and on emulation hardware before committing. The VCU was planned as multiple generations, and the next generation was set to add AV1, which compresses better than VP9 and costs even more to encode. In other words, YouTube built a pipeline where codec progress depends on silicon progress, and planned for that from the start.
Delivery: Google Global Cache inside ISP networks
Once renditions exist, the problem becomes moving bytes to viewers without hauling every request across the internet. Google's answer for this kind of content is Google Global Cache (GGC).
GGC lets ISPs "serve certain Google content from within their own networks." Google supplies the cache hardware; the ISP provides rack space, power, and a network connection; Google operates the cache remotely. The ISP gives Google the node's IP subnets, a BGP feed (peer ASN and addresses), and a maximum egress rate toward its users.

Google's documentation gives three properties that matter for streaming:
Hit rate. Typically 70-90% of cacheable traffic can be served from GGC, varying with each operator's viewing patterns.
Transparency. Requests are served from caches inside the ISP without users noticing.
Redundancy. GGC has "multiple levels of redundancy," and Google says users are always served from the best available data location even during a temporary outage.
The BGP feed is the quiet but important part. Google lists it as a setup requirement without explaining how it is used. The most likely role is telling Google which of the ISP's user prefixes a node should serve, so those customers can be pointed at a cache inside their own provider. If that reading is right, popular videos that are watched over and over stop crossing long-haul transit links at all. The exact rules Google uses to pick a node for a given request are not public.
Playback: how the player picks quality and latency
The final decision happens on the viewer's device. YouTube's help page says it "changes the quality of your video stream based on your viewing conditions," and lists the factors:
the speed of the internet connection
the player or screen size
the quality of the original upload (a standard-definition upload will never be available in HD)
browser support for newer formats; some 1080p and 4K formats need VP9
Viewers can override Auto with Higher picture quality (more data, possibly slower start and more buffering), Data saver (lower quality, faster start), or Advanced (pick a resolution manually). These options expose the same trade-off the system makes automatically: picture quality against start time and rebuffering.
Live streams add a second trade-off. YouTube's latency guide says the read-ahead buffer is "the main source of stream latency," so lowering latency means a smaller buffer and more exposure to network hiccups between encoder and player. Creators choose one of three modes:
| Latency mode | Typical viewer delay | Limits |
|---|---|---|
| Normal | Highest of the three | All resolutions and features; least buffering |
| Low | Under 10 seconds for most viewers | No 4K |
| Ultra-low | Under 5 seconds for most viewers | No 4K; more buffering risk |
This is why the ingest table matters: segment-based HLS and DASH ingest suit normal latency, while ultra-low latency streams use RTMP or RTMPS.
Failure domains and blast radius
YouTube does not publish a failure-domain map, but its public documents show where failures are contained at each layer.

| Layer | What fails | What limits the blast radius |
|---|---|---|
| Creator network | Upload link drops or cannot sustain bitrate | Stream health monitoring; lower latency modes make this more visible to viewers |
| Live ingest | Primary ingest endpoint unavailable | Redundant copy sent to the backup ingest URL |
| Transcoding | Accelerator or machine failure | The VCU paper reports improved failure management over the CPU baseline |
| Edge delivery | A GGC node goes down | Multiple levels of redundancy; users served from the best available location |
| Viewer network | Bandwidth drops mid-video | Auto quality steps down; the read-ahead buffer absorbs short dips |
The pattern is consistent: each layer has a fallback that keeps the failure local. A dead cache node does not stop transcoding, a transcoding failure does not take down delivery of videos that are already encoded, and a brief bandwidth dip on the viewer's side is handled by the player without involving the server at all.
Results and tradeoffs
The public record supports a short list of outcomes and costs:
Efficiency: 20-33x better transcoding efficiency with the VCU, which made VP9 practical at YouTube's volume.
Elastic capacity: the pandemic surge (25 percent more watch time, 45 percent more daily livestreams) was absorbed while keeping uploads available promptly.
Bandwidth relief for ISPs: typically 70-90% of cacheable traffic served from GGC nodes inside the ISP.
The trade-offs are just as clear:
Codec efficiency costs encode compute. VP9 is about 5x as expensive to encode as H.264, and AV1 more again.
Hardware locks in decisions. New codecs arrive with new chip generations, on hardware timelines.
Latency costs quality. Low and ultra-low latency live modes drop 4K and raise buffering risk; segment-based ingest adds delay.
What I would steal for a smaller video platform
Transcode once, serve many times. Produce a fixed set of renditions at upload time and serve them as static files. Players then adapt by choosing files, and the server never re-encodes on demand.
Be strict about inputs. YouTube's upload guidance (closed GOPs, fast-start MP4, normalized colour) is a cheap way to make your transcoder predictable. Validate inputs and normalize them before encoding.
Accept redundant live ingest from day one. A primary and backup ingest URL with a copy identifier costs little and removes the most common single point of failure for live events.
Put the cache where the viewers are. You will not ship servers to ISPs, but a CDN with good regional coverage gives you the same effect: most bytes should never touch your origin.
Pick codecs by cost, not just quality. Measure encode cost per hour of video before switching codecs. YouTube's 5x VP9 figure is why it built hardware, and a small team usually wants a managed transcoding service instead.
FAQ
What video format does YouTube stream?
YouTube transcodes each upload into several resolutions and codecs. Its help pages reference H.264 and VP9 for playback, and some high resolutions such as 4K require a browser or device with VP9 support. AV1 was added to the next generation of YouTube's transcoding chip.
What is YouTube's Video Coding Unit (VCU)?
The VCU is a custom chip and software system Google built to transcode video in its data centers. YouTube reports 20-33x better compute efficiency than its previous optimized software system on regular servers.
How does YouTube deliver video so close to viewers?
Through Google Global Cache, Google-operated cache servers hosted inside ISP networks. Google says GGC typically serves 70-90% of cacheable traffic, so most popular content never crosses the wider internet.
Why does YouTube video quality change while I watch?
On Auto quality, YouTube adjusts the stream to your connection speed, player size, the source video's quality, and your browser's codec support. You can override this with Higher picture quality, Data saver, or a manual resolution.
Which protocol should I use to live stream to YouTube?
YouTube recommends RTMPS for most streams. Use HLS or DASH ingest for 4K or HDR, accepting higher latency. Ultra-low latency streams (under 5 seconds for most viewers) cannot use 4K.
Sources
Reimagining video infrastructure to empower YouTube - YouTube Blog
Warehouse-Scale Video Acceleration: Co-design and Deployment in the Wild - Google Research
Choose live encoder settings, bitrates, and resolutions - YouTube Help
YouTube Live Streaming Ingestion Protocol Comparison - Google for Developers
Delivering Live YouTube Content via HLS - Google for Developers
Image credits
- Cover: AI-generated illustration