a technical analysis of the adaptive bit rate technology in dash – dynamic adaptive streaming over...

25
A Technical Analysis of the Adaptive Bit Rate Technology in DASH – Dynamic Adaptive Streaming over HTTP Brian Bresnahan, [email protected] Harvard University Extension School CSCI- E139 Spring 2013, Len Evenchik

Upload: luisa-kitchell

Post on 14-Dec-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

A Technical Analysis of the Adaptive Bit Rate Technology in DASH – Dynamic Adaptive

Streaming over HTTP 

Brian Bresnahan, [email protected]  

Harvard University Extension School CSCI-E139 Spring 2013, Len Evenchik

Basic Network Diagram and Data Flow

Internet

Server

Video Media-Encoding 1-Encoding 2

Video Playback Device 1

Video Playback Device N

Fundamental Problem

How can you maintain seemless video and audio playback over a network that can not guarantee quality of service ?

Solution:  A streaming algorithm that adjusts to the bandwidth available on the network.

Video Streaming Technologies

• Adobe Flash progressive download• Apple HTTP Live Streaming• Microsoft Smooth Streaming (Netflix)• Adobe HTTP Dynamic Streaming 

• NEW! DASH – Dynamic Adaptive Streaming over HTTP

Empirical Network Analysis of Video Streaming Providers

Video Company

Proto-col

CDN Player Technology Notes

Hulu HTTP Akamai Adobe Flash

Youtube HTTP no Adobe Flash HTTP GET of a file of mime-type video/x-flv. For 360p, every 6-10 seconds a 1.7 MB file is downloaded.

At 720p, player continuously downloads using HTTP a large file with mime-type video/mp4.  e.g. 53 minute video is 1.3 GB

Netflix HTTP Limelight or Netflix

Microsoft Smooth Streaming and Silverlight

Silverlight is the player software technology.

Packet capture analysis done with Wireshark and Google Chrome browser Developer tools on my home network.

Video Codecs and BitratesCodec Bitrate Resolution

Width (pixels)Resolution Height (pixels)

Notes

AVC1 256 Kbps 320 240AVC1 512 Kbps 320 240AVC1 1 Mbps 640 480AVC1 1.384 Mbps 640 480AVC1 1.5 Mbps 1280 720AVC1 2.0 Mbps 1280 720MPEG-2 7.0 Mbps 720 480 DVD resolution. (playback 

bitrate from PS3)  AVC1 22 Mbps 1920 1080 Blu-Ray DVD resolution. 

(Playback bitrate from PS3. May burst up to 40 Mbps)

? ? 3840 2160 “2K” UHDTV.  Also “4K”.

Audio Codecs and Bitrates

Codec Bitrate Channels

MP4 audio 32 Kbps 2

MP4 audio 64 Kbps 2

MP2 audio 448 Kbps 5.1

Adaptive Bitrate AlgorithmA video streaming system should dynamically adapt to the network conditions and playback device CPU load then automatically select the highest possible resolution the network can support.   The general concept is called “adaptive bitrate streaming” (ABR).   It was conceived by the DVD Forum in 2002 (Wikipedia , Adaptive Bit Rate) .   ABR follows this simple algorithm:

1. Encode the media at various resolutions, color depth, frame rate. The result is multiple data sets with different sizes which in turn will require different network bandwidths for streaming for playback.

2. As the media is played, the client monitors the playback.  If the playback stalls, use a lower bitrate encoding.

3. If the playback is not stalling and there is bandwidth available such that the player can use a higher bitrate encoding, switch to the higher bitrate encoding

DASH Specification

The specification was promoted by the Motion Pictures Expert Group (MPEG), “a working group of ISO/IEC with the mission to develop standards for coded representation of digital audio and video and related data.” (http://mpeg.chiariglione.org)

DASH under development since 2009.

Dynamic Adaptive Streaming over HTTP (DASH) ISO Specification Number 23009-1

DASH Architecture Elements

• HTTP/Web Servers, not proprietary servers• HTTP – Hypertext Transfer Protocol

– Based on TCP, a reliable protocol that guarantees byte order– Already has encryption standards– Is stateless, making the server simple.  Forces the complexity 

to the client where ABR algorithm needs to run.– Allows for “partial GET”

• XML based Manifest .MPD file

• Goal: support Live Event streaming as well as static encoded media

DASH Network Model

Operational Steps1. A back-end process is used to prepare and encode the media.  This is the box on 

the left.   This needs to be done before any clients can view the media.2. The DASH client requests from the DASH server a “manifest” XML file called the 

MPD (Media Presentation Description) file.  This file contains information regarding all available bitrates i.e. “Representations” for a particular video.  

3. The media playing software application uses the DASH client to select a video and audio bitrate from the manifest and begins downloading both separately with HTTP.

4. The DASH client is codec agnostic so it passes the received video frames and audio packets to the media application to render them with the codecs on the operating system the application is running on.

5. The DASH client runs the ABR algorithm previously described .   If the video or audio segments are downloading well, the next higher bit rate may be switched to.  Similarly, if the segment download rate is insufficient for the chosen bitrate, a lower bitrate stream will be selected.

6. The DASH client repeatedly does HTTP GETs for segments of video and audio data until the video and audio playback is complete.

DASH Data Model Elements

Master Media

0 60 120 180

Period 1

Media Presentation Timeline ->

Period 2 Period 3

Adaptation set 0 (video)

Representation 0 (1 Mbps)

Adaptation set 1 (audio)

Representation 1 (2 Mbps)

Segment 0Http://

streamer.harvard.edu/e_139_vid1_2mbps_0

Segment 1Http://

streamer.harvard.edu/e_139_vid1_2mbps_1

Segment 2Http://

streamer.harvard.edu/e_139_vid1_2mbps_2

Representation 2 (trick mode)

Media Stream Access Points

Representation 0 (1 Mbps)SAP 0 = aSAP 1 = bSAP 2 = c

Representation 1 (2 Mbps)SAP 0 = dSAP 1 = eSAP 2 = f

Segment 0Http://

streamer.harvard.edu/e_139_vid1_2mbps_0

Segment 1Http://

streamer.harvard.edu/e_139_vid1_2mbps_1

Segment 2Http://

streamer.harvard.edu/e_139_vid1_2mbps_2

Segment 0Http://

streamer.harvard.edu/e_139_vid1_1mbps_0

Segment 1Http://

streamer.harvard.edu/e_139_vid1_1mbps_1

Segment 2Http://

streamer.harvard.edu/e_139_vid1_1mbps_2

a b c

d e f

Required for the DASH client to be able to seamlessly switch bitrates as network bandwidth increases or decreases.

Media Presentation Description File<?xml version="1.0"?> <MPD xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns="urn:mpeg:DASH:schema:MPD:2011" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" type="static" mediaPresentationDuration="PT3256S" minBufferTime="PT1.2S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">  <BaseURL>http://cdn1.example.com/</BaseURL> <Period> <!-- Audio --> <AdaptationSet mimeType="audio/mp4" codecs="mp4a.0x40" lang="en" subsegmentAlignment="true" subsegmentStartsWithSAP="1"> <ContentProtection schemeIdUri="urn:uuid:706D6953-656C-5244-4D48-656164657221"/> <Representation id="1" bandwidth="64000"> <BaseURL>7657412348.mp4</BaseURL> </Representation> <Representation id="2" bandwidth="32000"> <BaseURL>3463646346.mp4</BaseURL> </Representation> </AdaptationSet>  <!-- Video --> <AdaptationSet mimeType="video/mp4" codecs="avc1.4d0228" subsegmentAlignment="true" subsegmentStartsWithSAP="2"> <ContentProtection schemeIdUri="urn:uuid:706D6953-656C-5244-4D48-656164657221"/>  <Representation id="1" bandwidth="1024000" width="640" height="480"> <BaseURL>streamer.harvard.edu/e139_vid_2_1mbps.mp4</BaseURL> </Representation> <Representation id="2" bandwidth="2048000" width="1280" height="720"> <BaseURL> streamer.harvard.edu/e139_vid_2_2mbps.mp4</BaseURL> </Representation> </AdaptationSet> </Period> </MPD>

Use of URLsDASH supports three main methods of retrieving video and audio data using URLs.• By specifying an exact URL to a file.  It needs to be retrieved with an HTTP 

GET.   In this approach, the DASH client must get the entire file.   The files are explicitly named in the MPD file.

• By specifying an exact URL to a file with expectation that an HTTP partial GET will be used to retrieve data from a start byte to an end byte.   In this approach, the DASH client can repeatedly read different parts of the same file.

• By a method called “Template based Segment URL Construction” (DASH Spec p. 48).  In this method, variables $RepresentationId$ and $Number$ are placed in the MPD file.  The DASH client uses them to dynamically create the URL needed to make a request for.  

URL Method 2 ExampleThis example is of method 2 described above.   The MPD has 2 separate URLs for retrieving 1 Mbps encoded or 2 Mbps encoded media from the ficticious server streamer.harvard.edu:

<Representation id="1" bandwidth="1024000" width="640" height="480"> <BaseURL>streamer.harvard.edu/e139_vid_2_1mbps.mp4</BaseURL> </Representation>  <Representation id="2" bandwidth="2048000" width="1280" height="720"> <BaseURL> streamer.harvard.edu/e139_vid_2_2mbps.mp4</BaseURL> </Representation>

Note that since the Representation does not describe a variable name for the URL, then the expectation is HTTP partial GETs using begin and end bytes will be used to retrieve segment data. 

URL Method 3 Example<BaseURL>CSCIE_139_Lecture5_</BaseURL> <SegmentTemplate media="$RepresentationID$_$Number%05$.ts" index="$RepresentationID$.sidx" > <Representation id="1130kbps" bandwidth="1243000" width="704" height="400"/> <Representation id="2100kbps" bandwidth="2310000" width="1120" height="640"/>  From the above BaseURL tag and Segment Template, the DASH client can synthesize the following URLs over time:

CSCIE_139_Lecture5_1130kbps_00000.tsCSCIE_139_Lecture5_1130kbps_00001.ts…

Other DASH Features• Metric Reporting – the DASH spec defines 3 “observation points” that 

can be used to monitor the DASH client retrieving segments with HTTP and feeding the data to the client applicaton. (ISO, DASH Specification , p. 107)

• Switchable and selectable streams – useful to select different language audio streams or different camera angles if available.

• Ad insertion – DASH defines the ability to insert ads between Periods or Segments. 

• Multiple Base URLS – the Representation can specify multiple URLs to allow the client to use different servers or CDNs if needed

• Clock drift control – for live sessions, the UTC time can be included with each segment to allow the client to adjust playback to match the server’s encode rate.

Current DASH Research and Demo Sites

• France GPACA team in France is focused on creating multimedia software they collectively call GPAC.  GPAC is an Open Source multimedia framework for research and academic purposes.  http://gpac.wp.mines-telecom.fr/home/

• DASH Industry ForumDASH is promoted by this organization which is in turn funded by large corporations interested in DASH mentioned in the overview of this paper.   They have developed a reference client media player that implements DASH.  Note that you must run Chrome to use their player.

• http://dashif.org/reference/players/javascript/0.2.0/index.html

• Opensource libdash library. This is a C++ library that implements the MPEG-DASH standard specified by ISO-23009-1.   It uses the libcurl library which contains HTTP.   http://www.bitmovin.net/libdash/

• DASH test methodThis research team wrote a paper on how to correctly test DASH with reference media.

• http://web.cs.wpi.edu/~claypool/mmsys-dataset/2012/dhttp/p89-lederer.pdf

• Google/YoutubeGoogle has a team that implemented an experimental DASH client.  This is interesting because Youtube streaming is currently based on Adobe Flash. 

Youtube/Google DASH Demo Page

Bitrate Transition in Youtube DASH Log

• 31: DASH MSE/EME demo version 0.2-165-gfee2015• 31: -------- Initializing --------• 35: 1, XHR for manifest sent• 230: 2, Manifest received• 393: 3, onSourceOpen()• 398: 4, updateRepresentationForm()• (AUTHOR’S NOTE: the “87” file is initial video file and “8c” is the audio file.)• 896: 2, Sent XHR: url=http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-87.mp4, 

range=bytes=0-1183• 899: 2, Sent XHR: url=http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-8c.mp4, 

range=bytes=0-851• (AUTHOR’S NOTE: REMOVED PART OF LOG.  Note the next line shows the player selecting  a video file with a 

different bit rate.)• 1899: Selected new rate 265000 for bandwidth 948028.9207168575 (from 948028.9207168575, 

1387512.245929166)• 1900: 3, onRepChange• 1904: 1, resetSourceBuffer• 2396: 2, Sent XHR: url=http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-85.mp4, 

range=bytes=0-1147• 2397: 2, Sent XHR: url=http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-8c.mp4, 

range=bytes=159832-318918

Conclusion

• DASH exemplifies the engineering of the internet.   That is, it is built on previously designed and proven building blocks.  

• DASH is built largely on HTTP and also on XML.   Beneath HTTP is the TCP protocol delivering an error-free, ordered byte stream required for quality video display and audio playback.  

• HTTP and TCP are available in a wide variety of devices today from handheld computers such as iPhones to HD TVs, creating the possibility of DASH being deployed on this wide variety of devices.    

• The design of DASH appears to be solid.

Project References• ISO, DASH Specification. Dynamic Adaptive Streaming over HTTP (DASH) 

ISO 23009-1. Geneva, Switzerland, 1 April 2012.• DASH Industry Forum. n.d. http://dashif.org/• Iraj Sodagar. The MPEG-DASH Standard for Multimedia Streaming over the 

Internet. October 2011.• L. Peterson, B. Davie. Computer Networks, 5th Edition. March 2011.• w3c. HTML5 Specification. 2013.• Wikipedia. Adaptive Bitrate Streaming. 2012.• Video Demystified, Keith Jack.  2007.  For MPEG-2 and MPEG-4 definitions.• DASH Industry Forum, 

http://dashif.org/reference/players/javascript/0.2.0/index.html• Google / Youtube DASH team, 

http://dash-mse-test.appspot.com/decoder-test.html

Thank you!