SlideShare une entreprise Scribd logo
1  sur  47
Streaming Video to HTML
Jeff Tapper
Digital Primates
@jefftapper
Who am I?
• Senior Consultant at Digital Primates
– Building next generation client applications
• Built video applications for many of the most
attended streaming events.
• Developing Internet applications for 17 years
• Author of 12 books on Internet technologies
Agenda
• Video and the Internet today
• Understanding HTTP Streaming
• What are the Streaming options without a
plugin?
• Understanding MediaSource Extensions (MSE)
• What is DASH
• Making it work in a browser
• Questions
Video is dominating the Internet
• Desktop: Video makes up 50% of traffic at peak periods
– notably 30% from Netflix and 11% from YouTube
• Mobile: Video traffic is growing exponentially
Fixed Internet Mobile Internet
HTTP Adaptive Streaming
Media Capture & Encoding
Media Origin Servers HTTP Cache Servers Client Devices
0010101000
01010
0101010100
01110
0111010001
1010101
0010101000
01010
0101010100
01110
0111010001
1010101
0010101000
01010
0101010100
01110
0111010001
1010101
0010101000010
10
0101010100011
10
0111010001101
0101
Encode each segment
at multiple bitrates
2 Split the video into
small segments
1
Make each segment
addressable via a HTTP-URL3
Client makes decision
on which segment to
download
4
Client splices together
and plays back5
HTTP Streaming Landscape
• Apple’s HTTP Live Streaming (HLS)
• Microsoft’s Smooth Streaming
• Adobe’s HTTP Dynamic Streaming (HDS)
• And many more…
The challenge
• Most agree that HTTP Streaming is the most
efficient choice
• Different devices support different streaming
protocols
• No one standard is currently supported
ubiquitously
• Results in media being served in several
different formats to support the broadest
range of devices
What do browsers support?
• Unfortunately, Progressive Download is the only
ubiquity supported option
• Different Browsers support different video
codec’s
– H.264
– webM
– Etc.
• Safari (iOs and MacOS only) natively supports HLS
• MediaSource Extensions in Chrome (and soon
others)
MediaSource Extensions (MSE)
• MSE allow for pieces (segments) of media to
be handed to the HTML5 video tag’s buffer
directly.
• This enables HTTP Streaming in HTML
• Not universally supported, yet.
What is MPEG-DASH
 DASH – Dynamic Adaptive Streaming via HTTP
 International open standard, developed and
published by ISO
 Addresses both simple and advanced use cases
 Enables highest-quality multiscreen distribution
and efficient dynamic adaptive switching
 Enables reuse of existing content, devices and
infrastructure
 Attempts to unify to a single standard for HTTP
Streaming
DASH and codecs
• The DASH specification is codec agnostic
• Any existing or future codec can work with
DASH
• DASH manifest describes which codec is used
– Different codecs store the actual video data
differently
DASH264
• H.264 is dominant format today
• Many vendors and service providers are
committed to supporting/enabling DASH264
• Provides support for today’s requirements
such as DRM
• H.264 is backed by rigorous testing and
conformance
DASH Industry Forum
• Addressing the dramatic growth of broadband
video by recommending a universal delivery
format that provides end users with the best
possible media experience by dynamically
adapting to changing network conditions.
DASH Industry Forum
• Objectives:
– promote and catalyze market adoption of MPEG-DASH
– publish interoperability and deployment guidelines
– facilitate interoperability tests
– collaborate with standard bodies and industry
consortia in aligning ongoing DASH standards
development and the use of common profiles across
industry organizations
• Over 65 members
• Visit http://dashif.org for more information
• Released the DASH/264 standard
Building a DASH player
• We have built DASH players for several
different platforms
– Flash
– Android
– HTML5/JavaScript (dash.js)
• DASH.js is available as an open source project
(bsd3) on github
• DASH.js is the reference player for the DASH
Industry Forum (dashif.org)
How to play a DASH Stream
• Download Manifest
• Parse Manifest
• Determine optimal bandwidth for client
• Initialize for bandwidth
• Download Segment
• Hand segment to MSE
• Check Bandwidth to determine if change is
necessary
Understanding DASH structure
• Three types of files
– Manifest (.mpd)
• XML file describing the segments
– Initialization file
• Contains headers needed to decode bytes in segments
– Segment Files
• Contains playable media
• Includes:
– 0…many video tracks
– 0…many audio tracks
DASH Manifest
• Manifest contains:
– Root node
– 1 or more periods
• Periods contain 1 adaptation set per video stream and
• Periods contain 1 adaptation set per audio stream
• Adaptation Sets contain:
– Content Composition nodes (for each video or audio track)
– 1 or more Representation node
» Each representation describes a single bitrate
» Representations contain data on finding the actual segments
» Different ways a representation can describe segments
Describing Representations
• SegmentBase
– Describes a stream with only a single Segment per bitrate
– Can be used for Byte Range Requests
• SegmentList
– A SegmentList will contain a specific list of each
SegmentURL (individual HTTP packet with media data)
– Can be used for Byte Range Requests
• SegmentTemplate
– Defines a known url for the fragment with wildcards
resolved at runtime to request a segments (see bbb.mpd)
– Alternatively, can specify a list of segments based on
duration
SegmentList
<Representation id="h264bl_hd" mimeType="video/mp4"
codecs="avc1.42c01f" width="1280" height="720" startWithSAP="1"
bandwidth="514864">
<SegmentList timescale="1000" duration="10000">
<Initialization sourceURL="mp4-main-multi-h264bl_hd-.mp4"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-1.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-2.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-3.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-4.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-5.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-6.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-7.m4s"/>
<SegmentURL media="mp4-main-multi-h264bl_hd-8.m4s"/>
SegmentTemplate fixed segment
duration
<AdaptationSet>
<ContentComponent id="1" contentType="video"/>
<SegmentTemplate
initialization="BigBuckBunny_720p_1800kbps_44khz_track1_dash.mp4"/>
<Representation id="1"
mimeType="video/mp4“ codecs="avc1.64001f"
width="1280" height="720“
startWithSAP="1" bandwidth="1809954">
<SegmentTemplate timescale="1000" duration="13809"
media="bbb_seg_BigBuckBunny_720p_1800kbps_44khz_track1$Number$.m4s"
startNumber="1"/>
</Representation>
</AdaptationSet>
SegmentTemplate variable segment
duration
<AdaptationSet group="2" mimeType="video/mp4" par="16:9“ minBandwidth="475000“
maxBandwidth="6589000" minWidth="176" maxWidth="1680"
minHeight="99" maxHeight="944“ segmentAlignment="true“
startWithSAP="1">
<SegmentTemplate timescale="1000"
initialization="dash/ateam-video=$Bandwidth$.dash"
media="dash/ateam-video=$Bandwidth$-$Time$.dash">
<SegmentTimeline>
<S t="0" d="4171" />
<S d="2503" />
<S d="2961" />
<S d="2461" />
<S d="2127" r="2" />
…
dash.js player
Tools used by dash.js
Core Player
• Q – Asynchronous handling with promises
• Dijon – DI / IOC
• Jasmine – unit tests
Web Site
• JQuery – DOM manipulation
• Flat-ui – UI elements
• Flot – Charting
• Kendo - Components
Class Structure
• The player is divided into two main packages.
• streaming – Contains the classes responsible
for creating and populating the MediaSource
buffers. These classes are intended to be
abstract enough for use with any segmented
stream (such as DASH, HLS, HDS and MSS).
• dash – Contains the classes responsible for
making decisions specifically related to Dash.
streaming package
MediaPlayer.js
• Exposes the top level functions and properties
to the developer (play, autoPlay, isLive, abr
quality, and metrics).
• The manifest URL and the HTML Video object
as passed to the MediaPlayer.
Context.js
• The dependency mapping for the stream
package.
• The context is passed into the MediaPlayer
object allowing for different MediaPlayer
instances to use different mappings.
Stream.js
• Loads/refreshes the manifest.
• Create SourceBuffers from MediaSource.
• Create BufferManager classes to manage
SourceBuffers.
• Responds to events from HTML Video object.
• For a live stream, the live edge is calculated
and passed to the BufferController instances.
Debug.js
• Convenience class for logging methods.
• Default implementation is to just use
console.log().
• Extension point for tapping into logging
messages.
BufferController.js
• Responsible for loading fragments and
pushing the bytes into the SourceBuffer.
• Once play() has been called a timer is
started to check the status of the bytes in the
buffer.
• If the amount of time left to play is less than
Manifest.minBufferTime the next fragment
is loaded.
• Records metrics related to playback.
FragmentLoader.js
• Responsible for loading fragments.
• Loads requests sequentially.
ManifestLoader.js
• Responsible for loading manifest files.
• Returns the parsed manifest object.
AbrController.js
• Responsible for deciding if the current quality
should be changed.
• The stream metrics are passed to a set of
‘rules’.
• Methods:
getPlaybackQuality(type, data)
 type – The type of the data
(audio/video).
 data – The stream data.
DownloadRatioRule.js
• Validates that fragments are being
downloaded in a timely manner.
• Compares the time it takes to download a
fragment to how long it takes to play out a
fragment.
• If the download time is considered a
bottleneck the quality will be lowered.
InsufficientBufferRule.js
• Validates that the buffer doesn’t run dry
during playback.
• If the buffer is running dry continuously it
likely means that the player has a processing
bottleneck (video decode time is longer than
playback time).
LimitSwitchesRule.js
• Watches for competing rules to avoid constant
bitrate switches.
• If two or more rules are causing switches too
often this rule will limit the switches to give a
better overall playback experience.
dash package
DashContext.js
• Defines dependency mapping specific to the
dash package.
– Parser
– Index Handler
– Manifest Extensions
DashParser.js
• Converts the manifest to a JSON object.
• Converts duration and datetime strings into
number/date objects.
• Manages inheritance fields.
– Many fields are inherited from parent to child
nodes in DASH.
– For example, a BaseURL can be defined in the
<MPD> node and all <Representation> nodes
inherit that value.
DashHandler.js
• Responsible for deciding which fragment URL should be
loaded.
• Methods:
 getInitRequest(quality) – Returns an initialization
request for a given quality, if available.
 getSegmentRequestForTime(time, quality) – Returns
a fragment URL to load for a given quality and a given
time. Returns a Stream.vo.SegmentRequest object.
 getNextSegmentRequest(quality) – Returns the next
fragment URL to load. Assumes that
getSegmentRequestForTime() has already been called.
 getCurrentTime (quality) – Returns the time for the
last loaded fragment index.
DashHandler.js (cont’d)
• Uses available information in the manifest
(SegmentList, SegmentTemplate, SegmentBase).
• When using a single, non-fragmented mp4 file the SIDX box
will be loaded to determine byte ranges for segments.
Flow
1. Create the Context and MediaPlayer instances.
var context = new Dash.di.DashContext(),
player = new MediaPlayer(context);
2. Initialize MediaPlayer and set manifest URL.
player.startup();
player.setIsLive(false);
player.attachSource(manifest_url);
3. Attach HTML Video element.
video = document.querySelector(".dash-video-player
video"),
player.autoPlay = true;
player.attachView(video);
2. Call play()on the MediaPlayer (if autoPlay =
false).
3. The Stream object will be created and initialized with the
manifest URL.
4. The manifest is loaded and then parsed.
5.MediaSource, SourceBuffers, and
BufferControllers are created.
– Create one BufferController per stream type (usually
video and audio).
6. Set the duration of the MediaSource to the duration of the
manifest (or infinity for a live stream).
7. If the stream is live, calculate the live edge.
8. Call play() on the HTML video element.
9. The BufferManager instances create a timer. When the
timer ticks the state of the buffers is checked.
BufferManager.validate()
1. Check to see if the buffers need more data.
• Must be in a playing state.
• Must not already be loading data.
• Must require more data to be buffered.
amountBuffered < manifest.minBufferTime
2. If automatic ABR is enabled check to see if the bitrate
should be changed.
• Ask AbrController for the new quality.
• Rules will determine which bitrate to change to.
3. If initial playback, seeking, or the bitrate has changed load
the initialization fragment (if available).
4. Ask the IndexHandler for the next fragment request.
• If seeking pass the seek time to the IndexHandler.
• Otherwise ask for the ‘next’ fragment.
• Pass the bitrate to the IndexHandler.
6. The IndexHandler returns a SegmentRequest indicating
what action the BufferManager should take next.
• “download” – Download and append the fragment to the buffer.
• “stall” – Wait because the IndexHandler is not ready.
• “complete” – Signal that the stream has completed playback.
7. Repeat.
Resources
• GPAC
– http://gpac.wp.mines-telecom.fr
– Provides baseline test streams
– Provides baseline player
• MP4Parser
– http://code.google.com/p/mp4parser/
– Open Source java project
– Allows for display of contents within boxes
• DASH Industry Forum
– http://www.dashif.org
– Test Vectors
– Reference Player
Questions?

Contenu connexe

Tendances

Messaging With Apache ActiveMQ
Messaging With Apache ActiveMQMessaging With Apache ActiveMQ
Messaging With Apache ActiveMQBruce Snyder
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPCMax Alexejev
 
Messaging With ActiveMQ
Messaging With ActiveMQMessaging With ActiveMQ
Messaging With ActiveMQBruce Snyder
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013mumrah
 
Apache ActiveMQ and Apache ServiceMix
Apache ActiveMQ and Apache ServiceMixApache ActiveMQ and Apache ServiceMix
Apache ActiveMQ and Apache ServiceMixBruce Snyder
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsGavin Roy
 
Handle Large Messages In Apache Kafka
Handle Large Messages In Apache KafkaHandle Large Messages In Apache Kafka
Handle Large Messages In Apache KafkaJiangjie Qin
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actiondejanb
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewDmitry Tolpeko
 
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13Gosuke Miyashita
 
Scaling MQTT With Apache Kafka
Scaling MQTT With Apache KafkaScaling MQTT With Apache Kafka
Scaling MQTT With Apache Kafkakellogh
 
Transaction Support in Pulsar 2.5.0
Transaction Support in Pulsar 2.5.0Transaction Support in Pulsar 2.5.0
Transaction Support in Pulsar 2.5.0StreamNative
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 
Blue host openstacksummit_2013
Blue host openstacksummit_2013Blue host openstacksummit_2013
Blue host openstacksummit_2013Jun Park
 

Tendances (19)

Messaging With Apache ActiveMQ
Messaging With Apache ActiveMQMessaging With Apache ActiveMQ
Messaging With Apache ActiveMQ
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
 
Messaging With ActiveMQ
Messaging With ActiveMQMessaging With ActiveMQ
Messaging With ActiveMQ
 
Dynamic Adaptive Streaming over HTTP Dataset
Dynamic Adaptive Streaming over HTTP DatasetDynamic Adaptive Streaming over HTTP Dataset
Dynamic Adaptive Streaming over HTTP Dataset
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
Apache ActiveMQ and Apache ServiceMix
Apache ActiveMQ and Apache ServiceMixApache ActiveMQ and Apache ServiceMix
Apache ActiveMQ and Apache ServiceMix
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
 
Handle Large Messages In Apache Kafka
Handle Large Messages In Apache KafkaHandle Large Messages In Apache Kafka
Handle Large Messages In Apache Kafka
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
 
Janus & docker: friends or foe
Janus & docker: friends or foe Janus & docker: friends or foe
Janus & docker: friends or foe
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
 
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
 
Scaling MQTT With Apache Kafka
Scaling MQTT With Apache KafkaScaling MQTT With Apache Kafka
Scaling MQTT With Apache Kafka
 
10135 b 07
10135 b 0710135 b 07
10135 b 07
 
Transaction Support in Pulsar 2.5.0
Transaction Support in Pulsar 2.5.0Transaction Support in Pulsar 2.5.0
Transaction Support in Pulsar 2.5.0
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 
Blue host openstacksummit_2013
Blue host openstacksummit_2013Blue host openstacksummit_2013
Blue host openstacksummit_2013
 
Apache Kafka Demo
Apache Kafka DemoApache Kafka Demo
Apache Kafka Demo
 

En vedette

How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applicationsjeff tapper
 
Flex Unit 4 Feature Overview
Flex Unit 4 Feature OverviewFlex Unit 4 Feature Overview
Flex Unit 4 Feature Overviewjeff tapper
 
What’s under your skin
What’s under your skinWhat’s under your skin
What’s under your skinjeff tapper
 
5.동영상에 대하여 j.mp gnmove(2 p)
5.동영상에 대하여 j.mp gnmove(2 p)5.동영상에 대하여 j.mp gnmove(2 p)
5.동영상에 대하여 j.mp gnmove(2 p)하이퍼테크
 
Isep m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)
Isep   m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)Isep   m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)
Isep m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)Thierry Lestable
 
비디오 코덱
비디오 코덱비디오 코덱
비디오 코덱greenday96
 
Android media codec 사용하기
Android media codec 사용하기Android media codec 사용하기
Android media codec 사용하기Taehwan kwon
 
스트리밍 프로토콜
스트리밍 프로토콜스트리밍 프로토콜
스트리밍 프로토콜greenday96
 
LUMA Digital Brief 012 - Market Report Q4 2016
LUMA Digital Brief 012 - Market Report Q4 2016LUMA Digital Brief 012 - Market Report Q4 2016
LUMA Digital Brief 012 - Market Report Q4 2016LUMA Partners
 
MARKETING TECHNOLOGY LUMAscape
MARKETING TECHNOLOGY LUMAscapeMARKETING TECHNOLOGY LUMAscape
MARKETING TECHNOLOGY LUMAscapeLUMA Partners
 

En vedette (12)

How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applications
 
Flex Unit 4 Feature Overview
Flex Unit 4 Feature OverviewFlex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
 
What’s under your skin
What’s under your skinWhat’s under your skin
What’s under your skin
 
5.동영상에 대하여 j.mp gnmove(2 p)
5.동영상에 대하여 j.mp gnmove(2 p)5.동영상에 대하여 j.mp gnmove(2 p)
5.동영상에 대하여 j.mp gnmove(2 p)
 
Isep m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)
Isep   m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)Isep   m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)
Isep m2 m - iot - course 1 - update 2013 - 09122013 - part 3 - v(0.7)
 
비디오 코덱
비디오 코덱비디오 코덱
비디오 코덱
 
Android media codec 사용하기
Android media codec 사용하기Android media codec 사용하기
Android media codec 사용하기
 
스트리밍 프로토콜
스트리밍 프로토콜스트리밍 프로토콜
스트리밍 프로토콜
 
LUMA Digital Brief 012 - Market Report Q4 2016
LUMA Digital Brief 012 - Market Report Q4 2016LUMA Digital Brief 012 - Market Report Q4 2016
LUMA Digital Brief 012 - Market Report Q4 2016
 
VIDEO LUMAscape
VIDEO LUMAscapeVIDEO LUMAscape
VIDEO LUMAscape
 
MARKETING TECHNOLOGY LUMAscape
MARKETING TECHNOLOGY LUMAscapeMARKETING TECHNOLOGY LUMAscape
MARKETING TECHNOLOGY LUMAscape
 
DISPLAY LUMAscape
DISPLAY LUMAscapeDISPLAY LUMAscape
DISPLAY LUMAscape
 

Similaire à Streaming video to html

Media Source Extensions
Media Source ExtensionsMedia Source Extensions
Media Source ExtensionsFITC
 
Silverlight Wireshark Analysis
Silverlight Wireshark AnalysisSilverlight Wireshark Analysis
Silverlight Wireshark AnalysisYoss Cohen
 
MPEG DASH White Paper
MPEG DASH White PaperMPEG DASH White Paper
MPEG DASH White Paperidrajeev
 
Media Content Delivery Systems: 2nd Presentation
Media Content Delivery Systems: 2nd PresentationMedia Content Delivery Systems: 2nd Presentation
Media Content Delivery Systems: 2nd Presentationashbyb
 
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdfAliIssa53
 
Standards' Perspective - MPEG DASH overview and related efforts
Standards' Perspective - MPEG DASH overview and related effortsStandards' Perspective - MPEG DASH overview and related efforts
Standards' Perspective - MPEG DASH overview and related effortsIMTC
 
An Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular Environments
An Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular EnvironmentsAn Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular Environments
An Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular EnvironmentsAlpen-Adria-Universität
 
Windows Azure Media Services June 2013 update
Windows Azure Media Services June 2013 updateWindows Azure Media Services June 2013 update
Windows Azure Media Services June 2013 updateMingfei Yan
 
Adaptive Media Streaming over Emerging Protocols
Adaptive Media Streaming over Emerging ProtocolsAdaptive Media Streaming over Emerging Protocols
Adaptive Media Streaming over Emerging ProtocolsAlpen-Adria-Universität
 
Media Content Delivery Systems
Media Content Delivery SystemsMedia Content Delivery Systems
Media Content Delivery Systemsashbyb
 
On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...
On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...
On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...Amazon Web Services
 
Serverless Media Workflow
Serverless Media WorkflowServerless Media Workflow
Serverless Media WorkflowMooYeol Lee
 
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Chris Adamson
 
MPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and ConformanceMPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and ConformanceAlpen-Adria-Universität
 

Similaire à Streaming video to html (20)

Media Source Extensions
Media Source ExtensionsMedia Source Extensions
Media Source Extensions
 
Mm sys 2013-demo
Mm sys 2013-demoMm sys 2013-demo
Mm sys 2013-demo
 
Silverlight Wireshark Analysis
Silverlight Wireshark AnalysisSilverlight Wireshark Analysis
Silverlight Wireshark Analysis
 
Dos presentation by ahlam shakeel
Dos presentation by ahlam shakeelDos presentation by ahlam shakeel
Dos presentation by ahlam shakeel
 
MPEG DASH White Paper
MPEG DASH White PaperMPEG DASH White Paper
MPEG DASH White Paper
 
Media Content Delivery Systems: 2nd Presentation
Media Content Delivery Systems: 2nd PresentationMedia Content Delivery Systems: 2nd Presentation
Media Content Delivery Systems: 2nd Presentation
 
Multimedia Streaming Architecture
Multimedia Streaming ArchitectureMultimedia Streaming Architecture
Multimedia Streaming Architecture
 
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
 
Standards' Perspective - MPEG DASH overview and related efforts
Standards' Perspective - MPEG DASH overview and related effortsStandards' Perspective - MPEG DASH overview and related efforts
Standards' Perspective - MPEG DASH overview and related efforts
 
An Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular Environments
An Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular EnvironmentsAn Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular Environments
An Evaluation of Dynamic Adaptive Streaming over HTTP in Vehicular Environments
 
Multimedia streaming
Multimedia streamingMultimedia streaming
Multimedia streaming
 
Windows Azure Media Services June 2013 update
Windows Azure Media Services June 2013 updateWindows Azure Media Services June 2013 update
Windows Azure Media Services June 2013 update
 
Adaptive Media Streaming over Emerging Protocols
Adaptive Media Streaming over Emerging ProtocolsAdaptive Media Streaming over Emerging Protocols
Adaptive Media Streaming over Emerging Protocols
 
Media Content Delivery Systems
Media Content Delivery SystemsMedia Content Delivery Systems
Media Content Delivery Systems
 
On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...
On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...
On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED30...
 
Technology Update: MPEG-Dash
Technology Update: MPEG-DashTechnology Update: MPEG-Dash
Technology Update: MPEG-Dash
 
Serverless Media Workflow
Serverless Media WorkflowServerless Media Workflow
Serverless Media Workflow
 
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
 
Slide
SlideSlide
Slide
 
MPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and ConformanceMPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and Conformance
 

Dernier

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Dernier (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Streaming video to html

  • 1. Streaming Video to HTML Jeff Tapper Digital Primates @jefftapper
  • 2. Who am I? • Senior Consultant at Digital Primates – Building next generation client applications • Built video applications for many of the most attended streaming events. • Developing Internet applications for 17 years • Author of 12 books on Internet technologies
  • 3. Agenda • Video and the Internet today • Understanding HTTP Streaming • What are the Streaming options without a plugin? • Understanding MediaSource Extensions (MSE) • What is DASH • Making it work in a browser • Questions
  • 4. Video is dominating the Internet • Desktop: Video makes up 50% of traffic at peak periods – notably 30% from Netflix and 11% from YouTube • Mobile: Video traffic is growing exponentially Fixed Internet Mobile Internet
  • 5. HTTP Adaptive Streaming Media Capture & Encoding Media Origin Servers HTTP Cache Servers Client Devices 0010101000 01010 0101010100 01110 0111010001 1010101 0010101000 01010 0101010100 01110 0111010001 1010101 0010101000 01010 0101010100 01110 0111010001 1010101 0010101000010 10 0101010100011 10 0111010001101 0101 Encode each segment at multiple bitrates 2 Split the video into small segments 1 Make each segment addressable via a HTTP-URL3 Client makes decision on which segment to download 4 Client splices together and plays back5
  • 6. HTTP Streaming Landscape • Apple’s HTTP Live Streaming (HLS) • Microsoft’s Smooth Streaming • Adobe’s HTTP Dynamic Streaming (HDS) • And many more…
  • 7. The challenge • Most agree that HTTP Streaming is the most efficient choice • Different devices support different streaming protocols • No one standard is currently supported ubiquitously • Results in media being served in several different formats to support the broadest range of devices
  • 8. What do browsers support? • Unfortunately, Progressive Download is the only ubiquity supported option • Different Browsers support different video codec’s – H.264 – webM – Etc. • Safari (iOs and MacOS only) natively supports HLS • MediaSource Extensions in Chrome (and soon others)
  • 9. MediaSource Extensions (MSE) • MSE allow for pieces (segments) of media to be handed to the HTML5 video tag’s buffer directly. • This enables HTTP Streaming in HTML • Not universally supported, yet.
  • 10. What is MPEG-DASH  DASH – Dynamic Adaptive Streaming via HTTP  International open standard, developed and published by ISO  Addresses both simple and advanced use cases  Enables highest-quality multiscreen distribution and efficient dynamic adaptive switching  Enables reuse of existing content, devices and infrastructure  Attempts to unify to a single standard for HTTP Streaming
  • 11. DASH and codecs • The DASH specification is codec agnostic • Any existing or future codec can work with DASH • DASH manifest describes which codec is used – Different codecs store the actual video data differently
  • 12. DASH264 • H.264 is dominant format today • Many vendors and service providers are committed to supporting/enabling DASH264 • Provides support for today’s requirements such as DRM • H.264 is backed by rigorous testing and conformance
  • 13. DASH Industry Forum • Addressing the dramatic growth of broadband video by recommending a universal delivery format that provides end users with the best possible media experience by dynamically adapting to changing network conditions.
  • 14. DASH Industry Forum • Objectives: – promote and catalyze market adoption of MPEG-DASH – publish interoperability and deployment guidelines – facilitate interoperability tests – collaborate with standard bodies and industry consortia in aligning ongoing DASH standards development and the use of common profiles across industry organizations • Over 65 members • Visit http://dashif.org for more information • Released the DASH/264 standard
  • 15. Building a DASH player • We have built DASH players for several different platforms – Flash – Android – HTML5/JavaScript (dash.js) • DASH.js is available as an open source project (bsd3) on github • DASH.js is the reference player for the DASH Industry Forum (dashif.org)
  • 16. How to play a DASH Stream • Download Manifest • Parse Manifest • Determine optimal bandwidth for client • Initialize for bandwidth • Download Segment • Hand segment to MSE • Check Bandwidth to determine if change is necessary
  • 17. Understanding DASH structure • Three types of files – Manifest (.mpd) • XML file describing the segments – Initialization file • Contains headers needed to decode bytes in segments – Segment Files • Contains playable media • Includes: – 0…many video tracks – 0…many audio tracks
  • 18. DASH Manifest • Manifest contains: – Root node – 1 or more periods • Periods contain 1 adaptation set per video stream and • Periods contain 1 adaptation set per audio stream • Adaptation Sets contain: – Content Composition nodes (for each video or audio track) – 1 or more Representation node » Each representation describes a single bitrate » Representations contain data on finding the actual segments » Different ways a representation can describe segments
  • 19. Describing Representations • SegmentBase – Describes a stream with only a single Segment per bitrate – Can be used for Byte Range Requests • SegmentList – A SegmentList will contain a specific list of each SegmentURL (individual HTTP packet with media data) – Can be used for Byte Range Requests • SegmentTemplate – Defines a known url for the fragment with wildcards resolved at runtime to request a segments (see bbb.mpd) – Alternatively, can specify a list of segments based on duration
  • 20. SegmentList <Representation id="h264bl_hd" mimeType="video/mp4" codecs="avc1.42c01f" width="1280" height="720" startWithSAP="1" bandwidth="514864"> <SegmentList timescale="1000" duration="10000"> <Initialization sourceURL="mp4-main-multi-h264bl_hd-.mp4"/> <SegmentURL media="mp4-main-multi-h264bl_hd-1.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-2.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-3.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-4.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-5.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-6.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-7.m4s"/> <SegmentURL media="mp4-main-multi-h264bl_hd-8.m4s"/>
  • 21. SegmentTemplate fixed segment duration <AdaptationSet> <ContentComponent id="1" contentType="video"/> <SegmentTemplate initialization="BigBuckBunny_720p_1800kbps_44khz_track1_dash.mp4"/> <Representation id="1" mimeType="video/mp4“ codecs="avc1.64001f" width="1280" height="720“ startWithSAP="1" bandwidth="1809954"> <SegmentTemplate timescale="1000" duration="13809" media="bbb_seg_BigBuckBunny_720p_1800kbps_44khz_track1$Number$.m4s" startNumber="1"/> </Representation> </AdaptationSet>
  • 22. SegmentTemplate variable segment duration <AdaptationSet group="2" mimeType="video/mp4" par="16:9“ minBandwidth="475000“ maxBandwidth="6589000" minWidth="176" maxWidth="1680" minHeight="99" maxHeight="944“ segmentAlignment="true“ startWithSAP="1"> <SegmentTemplate timescale="1000" initialization="dash/ateam-video=$Bandwidth$.dash" media="dash/ateam-video=$Bandwidth$-$Time$.dash"> <SegmentTimeline> <S t="0" d="4171" /> <S d="2503" /> <S d="2961" /> <S d="2461" /> <S d="2127" r="2" /> …
  • 24. Tools used by dash.js Core Player • Q – Asynchronous handling with promises • Dijon – DI / IOC • Jasmine – unit tests Web Site • JQuery – DOM manipulation • Flat-ui – UI elements • Flot – Charting • Kendo - Components
  • 25. Class Structure • The player is divided into two main packages. • streaming – Contains the classes responsible for creating and populating the MediaSource buffers. These classes are intended to be abstract enough for use with any segmented stream (such as DASH, HLS, HDS and MSS). • dash – Contains the classes responsible for making decisions specifically related to Dash.
  • 27. MediaPlayer.js • Exposes the top level functions and properties to the developer (play, autoPlay, isLive, abr quality, and metrics). • The manifest URL and the HTML Video object as passed to the MediaPlayer.
  • 28. Context.js • The dependency mapping for the stream package. • The context is passed into the MediaPlayer object allowing for different MediaPlayer instances to use different mappings.
  • 29. Stream.js • Loads/refreshes the manifest. • Create SourceBuffers from MediaSource. • Create BufferManager classes to manage SourceBuffers. • Responds to events from HTML Video object. • For a live stream, the live edge is calculated and passed to the BufferController instances.
  • 30. Debug.js • Convenience class for logging methods. • Default implementation is to just use console.log(). • Extension point for tapping into logging messages.
  • 31. BufferController.js • Responsible for loading fragments and pushing the bytes into the SourceBuffer. • Once play() has been called a timer is started to check the status of the bytes in the buffer. • If the amount of time left to play is less than Manifest.minBufferTime the next fragment is loaded. • Records metrics related to playback.
  • 32. FragmentLoader.js • Responsible for loading fragments. • Loads requests sequentially. ManifestLoader.js • Responsible for loading manifest files. • Returns the parsed manifest object.
  • 33. AbrController.js • Responsible for deciding if the current quality should be changed. • The stream metrics are passed to a set of ‘rules’. • Methods: getPlaybackQuality(type, data)  type – The type of the data (audio/video).  data – The stream data.
  • 34. DownloadRatioRule.js • Validates that fragments are being downloaded in a timely manner. • Compares the time it takes to download a fragment to how long it takes to play out a fragment. • If the download time is considered a bottleneck the quality will be lowered.
  • 35. InsufficientBufferRule.js • Validates that the buffer doesn’t run dry during playback. • If the buffer is running dry continuously it likely means that the player has a processing bottleneck (video decode time is longer than playback time).
  • 36. LimitSwitchesRule.js • Watches for competing rules to avoid constant bitrate switches. • If two or more rules are causing switches too often this rule will limit the switches to give a better overall playback experience.
  • 38. DashContext.js • Defines dependency mapping specific to the dash package. – Parser – Index Handler – Manifest Extensions
  • 39. DashParser.js • Converts the manifest to a JSON object. • Converts duration and datetime strings into number/date objects. • Manages inheritance fields. – Many fields are inherited from parent to child nodes in DASH. – For example, a BaseURL can be defined in the <MPD> node and all <Representation> nodes inherit that value.
  • 40. DashHandler.js • Responsible for deciding which fragment URL should be loaded. • Methods:  getInitRequest(quality) – Returns an initialization request for a given quality, if available.  getSegmentRequestForTime(time, quality) – Returns a fragment URL to load for a given quality and a given time. Returns a Stream.vo.SegmentRequest object.  getNextSegmentRequest(quality) – Returns the next fragment URL to load. Assumes that getSegmentRequestForTime() has already been called.  getCurrentTime (quality) – Returns the time for the last loaded fragment index.
  • 41. DashHandler.js (cont’d) • Uses available information in the manifest (SegmentList, SegmentTemplate, SegmentBase). • When using a single, non-fragmented mp4 file the SIDX box will be loaded to determine byte ranges for segments.
  • 42. Flow 1. Create the Context and MediaPlayer instances. var context = new Dash.di.DashContext(), player = new MediaPlayer(context); 2. Initialize MediaPlayer and set manifest URL. player.startup(); player.setIsLive(false); player.attachSource(manifest_url); 3. Attach HTML Video element. video = document.querySelector(".dash-video-player video"), player.autoPlay = true; player.attachView(video);
  • 43. 2. Call play()on the MediaPlayer (if autoPlay = false). 3. The Stream object will be created and initialized with the manifest URL. 4. The manifest is loaded and then parsed. 5.MediaSource, SourceBuffers, and BufferControllers are created. – Create one BufferController per stream type (usually video and audio). 6. Set the duration of the MediaSource to the duration of the manifest (or infinity for a live stream). 7. If the stream is live, calculate the live edge. 8. Call play() on the HTML video element. 9. The BufferManager instances create a timer. When the timer ticks the state of the buffers is checked.
  • 44. BufferManager.validate() 1. Check to see if the buffers need more data. • Must be in a playing state. • Must not already be loading data. • Must require more data to be buffered. amountBuffered < manifest.minBufferTime 2. If automatic ABR is enabled check to see if the bitrate should be changed. • Ask AbrController for the new quality. • Rules will determine which bitrate to change to. 3. If initial playback, seeking, or the bitrate has changed load the initialization fragment (if available).
  • 45. 4. Ask the IndexHandler for the next fragment request. • If seeking pass the seek time to the IndexHandler. • Otherwise ask for the ‘next’ fragment. • Pass the bitrate to the IndexHandler. 6. The IndexHandler returns a SegmentRequest indicating what action the BufferManager should take next. • “download” – Download and append the fragment to the buffer. • “stall” – Wait because the IndexHandler is not ready. • “complete” – Signal that the stream has completed playback. 7. Repeat.
  • 46. Resources • GPAC – http://gpac.wp.mines-telecom.fr – Provides baseline test streams – Provides baseline player • MP4Parser – http://code.google.com/p/mp4parser/ – Open Source java project – Allows for display of contents within boxes • DASH Industry Forum – http://www.dashif.org – Test Vectors – Reference Player