Вы находитесь на странице: 1из 5

NETMANIAS

TECH-BLOG

Please visit www.netmanias.com to view more posts

YouTube, changing the way of delivering videos (1): Chunking and


Adaptive Streaming are In and Progressive Download is Out!
October 4, 2013 | By Harryson (tech@netmanias.com) | Netmanias Tech-Blog | www.netmanias.com

Recently, YouTube has changed/evolved the way it delivers video contents. It used to be a big fan of HTTP
progressive download (downloading a video file by a single request just like downloading a data file) until last
year. However, from this year, many efforts have been made by YouTube (e.g. switching to chunking and
adaptive streaming) for improved video delivery. We will focus on "switching into chunking" this time.

1. Conventional Video Delivery of YouTube


Before April 2013, YouTube videos were requested and delivered as follows:
YouTube PSY Gangnam Style (http://www.youtube.com/watch?v=9bZkp7q19f0)
Container Profile
MP4

MP4

1080p

720p

Resolution

Encoding
Rate

1920x1080

5.812 Mbps

1280x720

2.953 Mbps

URI Parameter
Video Codec
id
itag
f5b664a7bab5f5fd

f5b664a7bab5f5fd

37

22

H.264

H.264

File Size

Device

Reqeust

175 MB

PC

Whole file request

PC

Whole file request

Android

Partial request1

iDevice

Whole file request

Android

Partial request1

iDevice

Whole file request

88.8 MB

MP4

360p

640x360

719 Kbps

f5b664a7bab5f5fd

18

H.264

21.6 MB

FLV

480p

854x480

1.229 Mbps

f5b664a7bab5f5fd

35

H.264

37.0 MB

PC

Whole file request

FLV

360p

640x360

885 Kbps

f5b664a7bab5f5fd

34

H.264

26.6 MB

PC

Partial request2

FLV

240p

426x240

371 Kbps

f5b664a7bab5f5fd

H.263

11.2 MB

PC

Whole file request

3GP

240p

320x180

228 Kbps

f5b664a7bab5f5fd

36

MPEG-4

6.86 MB

Android

Partial request1

1 Byte Range (HTTP header), variable size request

2 Byte Range (URI Parameter), fixed size request

Please note that only downloading to PCs will be discussed in this post.
Youtube provides videos in many different resolutions (1080p, 720p, 480p, 360p, 240p). With the
conventional delivery method, only the ones in 360p resolution were requested and delivered in chunks,
whereas others were downloaded as one whole file by a single request (HTTP GET).
For detailed description, please see our technical document "Analysis of YouTube video request and delivery
(360p, 720p)".

Netmanias Tech-Blog: YouTube, changing the way of delivering videos (1): Chunking and Adaptive
Streaming are In and Progressive Download is Out!

YouTube Video Contents Request and Delivery Method (Before)


Resolution: 1080p | 720p | 480p | 240p
Downloading a whole file by a
single request
In actual measurements, the
whole file (88.8 MB) downloaded in
40 seconds
No automatic resolution change
A single TCP session

A single TCP
session

Video playback time: 4 minutes 12 seconds (e.g. Gangnam Style)

Resolution: 360p
Requesting next chunk constantly
while watching
Chunk size: Fixed 1.78MB
No automatic resolution change
A single TCP session

A single TCP
session

Video playback time: 4 minutes 12 seconds (e.g. Gangnam Style)

2. What's In and What's Out? (Progressive Download is out!)


The biggest change made is that, until last year, files in different resolutions (1080p~240p) were delivered as
one file containing both video and audio. And this allowed users to see video and hear audio by simply playing
the file. However, since April, 2013, video files and audio files are separated from each other, and hence users
have to download both of them separately.
But, the most important change was made in the way of delivering contents, i.e. from HTTP progressive
download to chunking. Here, chunks do not refer to the real chunks that are split into pieces and kept as
separate files (as 1.ts, 2.ts, 3.ts,...) in the server as in HLS (Apple's HTTP Live Streaming). But they refer to the
virtual ones, individual parts of a video file, that a device (PC) has downloaded one by one as needed by
performing range requests (range=0-4227071, range=4227072-8454143,...). So, YouTube can keep only one
video file per resolution, and thus manage the files with ease.
The figure below shows how the patterns of downloading a video file change when watching the video in 720p
resolution. Before April 2013, as seen in figure of [BEFORE], the whole file of size 88.8 MB was downloaded
upon a single request (HTTP GET). In our actual measurement, the Gangnam Style video file, 4 minutes and 12
seconds long, was downloaded in 40 seconds as seen in the figure below. This means the whole file is saved in
the PC even when the user stops watching it and leaves YouTube after only 40 seconds. From the figure, we
can also see that i) YouTube server worked so hard to deliver the unwatched part of the video, from the 41st
second to the end, to the PC for nothing, and ii) it delivered the initial part of the video at its maximum rate,

Netmanias Tech-Blog: YouTube, changing the way of delivering videos (1): Chunking and Adaptive
Streaming are In and Progressive Download is Out!

and then the rest at an adjusted lower rate after certain amount was delivered to the PC, by performing
appropriate pacing (throttling) during the delivery. Both i) and ii) cause high loads on the YouTube server.
The figure [AFTER] shows the patterns of requesting and delivering contents: The device made back-to-back
requests for the first 3~4 chunks to fill the receiving buffer. Then, it made requests for more chunks in about
every 20 seconds. If the user leaves without finishing the video, requests for additional chunks are not made,
allowing only about the volume actually watched to be downloaded. Eventually, the YouTube server's load
is significantly decreased.

BEFORE: Gangnam Style, 720p , 2012.0x.0x Progressive Download

Red Dot: HTTP GET


Downloading a whole file by a single
request
The whole file downloaded in 40 seconds
No automatic resolution change
A single TCP session

A file (88.8MB)

40s

Video playback time: 4 minutes 12 seconds

AFTER: Gangnam Style, 720p , 2013.08.12

Streaming (Chunk-base)

Blue Dot: HTTP GET (Video)


Red Dot: HTTP GET (Audio)
Requesting next chunk constantly while
watching
Each video chunk size: Fixed 4.25MB
Each audio chunk size: Fixed 0.48MB
No automatic resolution change
aA single TCP Session
No additional request when the user
presses Pause or stops while watching

A video chunk (4.23MB)


An audio chunk (0.48MB)

220s

Video playback time: 4 minutes 12 seconds

Changes in YouTube streaming in the particular resolution selected by user


Before
media file

1080p

720p

480p

360p

240p

144p

Single File
(Video &
Audio)
Single File
(Video &
Audio)
Single File
(Video &
Audio)
Single File
(Video &
Audio)
Single File
(Video &
Audio)
Single File
(Video &
Audio)

id

f5b664a7bab5f5fd

f5b664a7bab5f5fd

f5b664a7bab5f5fd

f5b664a7bab5f5fd

f5b664a7bab5f5fd

f5b664a7bab5f5fd

After
itag

37

22

35

34

17

Delivery
HTTP Progressive
Download
(the whole file request)
HTTP Progressive
Download
(the whole file request)

media file

id

itag

Video File

f5b664a7bab5f5fd 137

Audio File

f5b664a7bab5f5fd 141

Video File

f5b664a7bab5f5fd 136

Audio File

f5b664a7bab5f5fd 141

Video File

f5b664a7bab5f5fd 135

Audio File

f5b664a7bab5f5fd 141

Chunk-based HTTP
Streaming

Video File

f5b664a7bab5f5fd 134

(Chunk size: 1.78MB)

Audio File

f5b664a7bab5f5fd 140

HTTP Progressive
Download
(the whole file request)

Video File

f5b664a7bab5f5fd 133

Audio File

f5b664a7bab5f5fd 140

Video File

f5b664a7bab5f5fd 160

Audio File

f5b664a7bab5f5fd 140

HTTP Progressive
Download
(the whole file request)

HTTP Progressive
Download
(the whole file request)

Delivery
Chunk-based HTTP Streaming

(Video Chunk size: 7.934MB)


Chunk-based HTTP Streaming

(Audio chunk Size: 0.479MB)


Chunk-based HTTP Streaming

(Video Chunk size: 4.23MB)


Chunk-based HTTP Streaming

(Audio chunk Size: 0.479MB)


Chunk-based HTTP Streaming

(Video Chunk size: 2.101MB)


Chunk-based HTTP Streaming

(Audio chunk Size: 0.479MB)


Chunk-based HTTP Streaming

(Video Chunk size: 0.897MB)


Chunk-based HTTP Streaming

(Audio chunk Size: 0.238MB)


Chunk-based HTTP Streaming

(Video Chunk size: 0.467MB)


Chunk-based HTTP Streaming

(Audio chunk Size: 0.238MB)


Chunk-based HTTP Streaming

(Video Chunk size: 0.217MB)


Chunk-based HTTP Streaming

(Audio chunk Size: 0.238MB)

Netmanias Tech-Blog: YouTube, changing the way of delivering videos (1): Chunking and Adaptive
Streaming are In and Progressive Download is Out!

Why did YouTube switch?


With the conventional HTTP progressive download method, files can be downloaded as a whole file only. As
seen in the figure above, the entire file, 4 minutes and 12 seconds long, is downloaded within 40 seconds. So,
even when the user leaves after watching the first one minute only, the entire file is delivered through the
YouTube server anyway.
The YouTube server delivers, in vain, even the volume not to be watched by the user to the device (PC). On
the other hand, with the new method, a device makes requests for chunks only when the user is still watching
the video. As a result, the loads on the server are significantly decreased, making it possible for YouTube to
serve more users with fewer servers.
This will probably handle telecom operators' complaints about increasing free-riding traffic of YouTube to
some extent.
In a word, YouTube, by giving intelligence which used to be in the YouTube server to devices and making the
server dummy, converted its video delivery logic into one that allows less costly CDN expansion.
Before (Progressive Download)

Watching
another
video after
40 sec

After (Chunk)

Watching
another
video after
40 sec

Watching
another
video after
40 sec

User PC

Watching
another
video after
40 sec

YouTube Server

Internet or operators
network

High network costs


(Too bad)

BIG ($$$)

User PC

YouTube Server

Internet or operators
network

Small ($)

Low network costs


(Not too bad)

Netmanias Research and Consulting Scope


99

00

01

02

03

04

05

06

07

08

09

10

11

12

13

eMBMS/Mobile IPTV
CDN/Mobile CDN
Transparent Caching
BSS/OSS

Services

Cable TPS
Voice/Video Quality
IMS
Policy Control/PCRF
IPTV/TPS
LTE

Mobile
Network

Mobile WiMAX
Carrier WiFi
LTE Backaul
Data Center Migration
Carrier Ethernet
FTTH

Wireline
Network

Data Center
Metro Ethernet
MPLS
IP Routing

CDN
Transparent
Caching

Analysis

Networks

eMBMS

LTE
IMS
Infrastructure Services

Analyze trends, technologies and market


Report
Technical documents
Blog
One-Shot gallery

Concept Design
DRM

POC

Training

Wi-Fi

We design the future

protocols

IP/MPLS

We design the future

Carrier Ethernet

We design the future

Consulting

Visit http://www.netmanias.com to view and download more technical documents.

Future

About NMC Consulting Group (www.netmanias.com)


NMC Consulting Group is an advanced and professional network consulting company, specializing in IP network areas (e.g., FTTH, Metro Ethernet and IP/MPLS), service
areas (e.g., IPTV, IMS and CDN), and wireless network areas (e.g., Mobile WiMAX, LTE and Wi-Fi) since 2002.
Copyright 2002-2013 NMC Consulting Group. All rights reserved.