Adaptive streaming reference

An overview of adaptive bitrate streaming including browser support, features, and JW Player support for HLS and DASH.


Overview

Adaptive bitrate streaming is the ability for a video player to dynamically adjust video quality based on a user's available bandwidth, device performance, and network conditions. Most modern web browsers only support progressive video playback, which does not allow for seamless quality switching. Adaptive playback comes in many formats and protocols and the popularity of each format has changed over the years.

JWP supports two formats of adaptive streaming over HTTP in HTML5 - Apple HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP or MPEG-DASH. The following diagram illustrates Adaptive Streaming:

779

Video Playback with Adaptive Streaming



About HTTP Streaming

Streaming over HTTP allows a video player to choose the best quality video without proprietary software installed on a server. Video content exists on normal web servers and a video player is able to request assets by reading a manifest file. The manifest file provides the locations to various video qualities or renditions on the webserver and contains information about the codecs used to compress the video and bitrates which allow the player to determine the most suitable quality to play. The manifest also can contain multiple-audio track renditions as well as links to closed-caption or subtitle tracks. See Captions for more information about captions in streaming media.

In order to play either format, a video player is needed to parse the manifests, transmux into a browser/machine compatible format, and an adaptive engine to choose the correct video quality to play. JWP supports adaptive streaming over HTTP in all modern browsers.



Browser Support

Support for streaming technology depends on the browser and browser version. JWP works to fill in gaps where the browser does not natively support a codec for playing back the media.


BROWSERMPEG-DASHAPPLE HLS
Chrome 35+XX
Firefox 42+XX
Safari-X
Microsoft EdgeXX
IE11 on Windows 8.1+XX*
Chrome on Android 35+XX
Safari Mobile - iOS 8+-X

The following sections break down features and technical details supported by JWP for each respective streaming media format.



HLS Support

Apple HTTP Live Streaming (HLS) is a manifest format that Apple has written for streaming on iOS devices and on desktop Safari. Microsoft Edge and Chrome Android support older versions of HLS. HLS is delivered to a browser packaged as Transport Stream (.ts) files. The .ts video container has video compressed using the H.264 codec audio compressed with AAC. A manifest can also contain just .aac files as well. JWP only supports multiple-audio tracks if the audio is separate elementary .aac manifests as opposed to multiple .aac tracks embedded within the .ts container.



TS Container Codec Details

For adaptive live streams, all fragments should be self-initializing, meaning they start with a Program Map Table (PMT)/Program Association Tab (PAT) definitions and a full H.264 Instantaneous Decoder Refresh (IDR) frame. Live streams should also contain no B-frames or frames that rely on future and past data to decode. Using B-frames in a live stream will result in rendering errors, ranging from short stutters and macro block artifacts to an eventual stall of the stream. Common issues are the omission of keyframes in fragments, or misalignment of keyframes across quality levels.



HLS Features

JWP supports a subset of features from Protocol 6 Version 13 of the HLS IETF draft.

FEATUREDESKTOP HTML5MOBILE IOSANDROID CHROME
Alternative Audio RenditionsXXN/A
WebVTT subtitle tracksXXN/A
DiscontinuitiesXXX
ID3 Timed MetadataXXN/A
DVR sliding controlbarXXN/A
AES-128 DecryptionXXX
Apple FairPlay DRMXXX
Byte Range RequestsXXX
Redundant StreamsXXX

Features Not Supported

  • Decryption of encrypted streams with SAMPLE-AES
  • Alternate video renditions through #EXT-X-TYPE="VIDEO"
  • Support for presentation of streams containing just the I-frames, #EXT-X-IFRAME-INF


DASH Support

Dynamic Adaptive Streaming over HTTP (MPEG-DASH) is an ISO standard written and supported by an international team of media companies. The standard is designed to be codec agnostic and interoperable between browsers. DASH is supported in HTML5 and JavaScript by using Media Source Extensions and is available in modern browsers.

DASH file URLs are manifest's Media Presentation Documents (.mpd). The mpd files direct JWP to all the information necessary to begin streaming. DASH is codec-agnostic and will therefore work with files encoded in H.264/AAC or VP9/Vorbis. JW Platform encodes DASH streams using VP9 as it is more efficient than H.264.

Notable Features

  • Multi-period manifests
  • Side-loaded captions
  • DRM: Widevine and PlayReady
  • Multiple language tracks
  • Subtitle support


Embedding and Customizing Adaptive Streams

Embedding and publishing adaptive streams in JWP player is straightforward. JWP will pick the most suitable video engine to render the content based on the order of sources provided, such as:

var playerInstance = jwplayer("myElement");
	playerInstance.setup({ playlist:  [{ 
    image:  "/assets/myPoster.jpg", 
    sources:  [{ 
      file:  "/assets/myStream.mpd"  
    },{ 
      file:  "/assets/myStream.m3u8" 
    },{ 
      file:  "/assets/myStream.mp4"  
    }]  
  }],
});


Adaptive Bitrate Algorithm

Both HLS and MPEG-DASH have similar ABR algorithms that prioritize starting video as fast as possible. This means that the initial quality of a video can be lower even if there is bandwidth to download a higher quality video file. The player then up-switches to a higher quality as soon as it can fill a buffer without causing a rebuffer event for a viewer. The algorithm will also never request a higher quality that is larger than the width of the video player which helps saving bandwidth and provide the best user experience. When the size of the player changes, this an opportunity to scale to a higher or lower quality and adjust accordingly.

πŸ“˜

It is not possible to adjust the algorithm for ABR in JWP nor is it possible to force a starting rendition.



Additional Tools & Information

Manifest Validator - A third party tool that checks that a DASH manifest or video file is correctly structured and encoded. In order to get a stream functional JWP, it should validate here.

How to stream over MPEG DASH - A helpful guide from Wowza about getting your stream encoded and playing in the DASH format.