You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Zenky e4acc57ccf
docs: removing duplicated step (#1476)
1 year ago
..
images feat: rename many things to `main` (#1309) 3 years ago
lhls feat: rename many things to `main` (#1309) 3 years ago
README.md feat: rename many things to `main` (#1309) 3 years ago
a-walk-through-vhs.md feat: rename many things to `main` (#1309) 3 years ago
arch.md docs: Update arch.md (#1459) 2 years ago
bitrate-switching.md feat: rename many things to `main` (#1309) 3 years ago
content-steering.md docs: add docs for content steering (#1442) 2 years ago
creating-content.md test: fix IE11 encrypted VTT tests by using an actual encrypted VTT segment (#1291) 3 years ago
dash-playlist-loader.md feat: rename many things to `main` (#1309) 3 years ago
glossary.md feat: rename many things to `main` (#1309) 3 years ago
hlse.md Encrypted HLS working on the example page 11 years ago
media.md docs: add diagrams for playlist loaders (#426) 6 years ago
migration-2-3.md fix: remove deprecation hls options, properties, and events; add migration guide (#1229) 3 years ago
mse.md Add notes on sample offset calculation 10 years ago
multiple-alternative-audio-tracks.md docs: removing duplicated step (#1476) 1 year ago
player-time-to-program-time.md feat: Use exposed transmuxer time modifications for more accurate conversion between program and player times (#371) 7 years ago
playlist-loader.md feat: rename many things to `main` (#1309) 3 years ago
program-time-from-player-time.md feat: Use exposed transmuxer time modifications for more accurate conversion between program and player times (#371) 7 years ago
reload-source-on-error.md docs: add documentation for reloadSourceOnError (#266) 7 years ago
supported-features.md docs: add docs for content steering (#1442) 2 years ago
troubleshooting.md feat: rename many things to `main` (#1309) 3 years ago

README.md

Overview

This project supports both HLS and MPEG-DASH playback in the video.js player. This document is intended as a primer for anyone interested in contributing or just better understanding how bits from a server get turned into video on their display.

HTTP Live Streaming

HLS has two primary characteristics that distinguish it from other video formats:

  • Delivered over HTTP(S): it uses the standard application protocol of the web to deliver all its data
  • Segmented: longer videos are broken up into smaller chunks which can be downloaded independently and switched between at runtime

A standard HLS stream consists of a Main Playlist which references one or more Media Playlists. Each Media Playlist contains one or more sequential video segments. All these components form a logical hierarchy that informs the player of the different quality levels of the video available and how to address the individual segments of video at each of those levels:

HLS Format

HLS streams can be delivered in two different modes: a "static" mode for videos that can be played back from any point, often referred to as video-on-demand (VOD); or a "live" mode where later portions of the video become available as time goes by. In the static mode, the Main and Media playlists are fixed. The player is guaranteed that the set of video segments referenced by those playlists will not change over time.

Live mode can work in one of two ways. For truly live events, the most common configuration is for each individual Media Playlist to only include the latest video segment and a small number of consecutive previous segments. In this mode, the player may be able to seek backwards a short time in the video but probably not all the way back to the beginning. In the other live configuration, new video segments can be appended to the Media Playlists but older segments are never removed. This configuration allows the player to seek back to the beginning of the stream at any time during the broadcast and transitions seamlessly to the static stream type when the event finishes.

If you're interested in a more in-depth treatment of the HLS format, check out Apple's documentation and the IETF Draft Specification.

Dynamic Adaptive Streaming over HTTP

Similar to HLS, DASH content is segmented and is delivered over HTTP(s).

A DASH stream consits of a Media Presentation Description(MPD) that describes segment metadata such as timing information, URLs, resolution and bitrate. Each segment can contain either ISO base media file format(e.g MP4) or MPEG-2 TS data. Typically, the MPD will describe the various Representations that map to collections of segments at different bitrates to allow bitrate selection. These Representations can be organized as a SegmentList, SegmentTemplate, SegmentBase, or SegmentTimeline.

DASH streams can be delivered in both video-on-demand(VOD) and live streaming modes. In the VOD case, the MPD describes all the segments and representations available and the player can chose which representation to play based on it's capabilities.

Live mode is accomplished using the ISOBMFF Live profile if the segments are in ISOBMFF. There are a few different ways to setup the MPD including but not limited to updating the MPD after an interval of time, using Periods, or using the availabilityTimeOffset field. A few examples of this are provided by the DASH Reference Client. The MPD will provide enough information for the player to playback the live stream and seek back as far as is specified in the MPD.

If you're interested in a more in-depth description of MPEG-DASH, check out MDN's tutorial on setting up DASH or the DASHIF Guidelines.

Further Documentation

Helpful Tools