UNPKG

shaka-player

Version:
111 lines (88 loc) 3.91 kB
<!-- Copyright 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <h3 class="tutorial-heading"> DASH Streams at a High Level </h3> <p> Dynamic Adaptive Streaming over HTTP (DASH) is a technique for adaptive bitrate streaming of content over the Internet delivered from conventional web servers. This is a quick overview of DASH for those who are not familiar with it. For a more detailed view of DASH, visit {@link http://dashif.org/guidelines/ dashif.org}. </p> <p> Every DASH stream is described by a manifest written in XML. Within a manifest file, representation elements describe the DASH stream's audio, video, and text sources. There may be more than one representation of the same content. These typically differ in terms of bitrate and resolution, although there can be some other variations as well. </p> <p> Representations are grouped into one or more adaptation sets, and a DASH client can switch automatically between representations within a set. Adaptation sets can differ in codec and language. DASH streams usually have audio and video in separate adaptation sets. Although the DASH specification allows for audio and video to be multiplexed, the Shaka Player does not support this type of stream. </p> <h3 class="tutorial-heading"> Multiple Resolutions and Bitrates </h3> <p> For the Shaka Player to adapt and choose the best representation for the user's available bandwidth, you must encode your content into more than one resolution and bitrate. It is up to you what bitrates and resolutions make sense for your site. Note that you can encode at multiple bitrates for a single resolution. </p> <p> Example video encoding scheme: <ul> <li>1920x1080, 5.0 Mbit/s</li> <li>1920x1080, 3.0 Mbit/s</li> <li>1280x720, 2.0 Mbit/s</li> <li>1280x720, 1.0 Mbit/s</li> <li>854x480, 750 kbit/s</li> <li>640x360, 350 kbit/s</li> </ul> </p> <p> There are many open-source tools to transcode video, including: <ul> <li>ffmpeg <a href="https://www.ffmpeg.org/">https://www.ffmpeg.org/</a></li> <li>DASHEncoder <a href="https://github.com/slederer/DASHEncoder">https://github.com/slederer/DASHEncoder</a></li> </ul> </p> <h3 class="tutorial-heading"> Packaging Content </h3> <p> A DASH packager is required to get your media ready to stream. There are a few open-source packagers available for MP4 / ISO BMFF streams, including: <ul> <li>edash-packager <a href="https://github.com/google/edash-packager/">https://github.com/google/edash-packager/</a></li> <li>MP4Box <a href="http://gpac.wp.mines-telecom.fr/mp4box/">http://gpac.wp.mines-telecom.fr/mp4box/</a></li> <li>DASHEncoder <a href="https://github.com/slederer/DASHEncoder">https://github.com/slederer/DASHEncoder</a></li> <li>DASH.encrypt <a href="https://github.com/castlabs/dashencrypt">https://github.com/castlabs/dashencrypt</a></li> </ul> </p> <p> Your DASH packager will convert your content to a valid, segmented ISOBMFF file and generate a DASH manifest (MPD file). Most DASH packagers can not transcode your media into multiple resolutions and bitrates. (DASHEncoder does both.) </p> <p> To package WebM streams for DASH, the WebM project provides tools for this: <ul> <li>webm-tools <a href="http://www.webmproject.org/code/">http://www.webmproject.org/code/</a></li> </ul> The WebM project also provides <a href="http://goo.gl/cfJ2x3">a tutorial</a> on encoding WebM content for DASH. </p>