paint-brush
Optimizing Video Streaming with DASH Protocol by@hacker3640076
2,659 reads
2,659 reads

Optimizing Video Streaming with DASH Protocol

by KARTIK SAINMay 2nd, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

DASH (Dynamic Adaptive Streaming over HTTP) protocol is an increasingly popular video streaming technology that has come to the fore in recent years. It offers a flexible and efficient solution for delivering multimedia content over the internet. DASH is flexible and can be used for both live and on-demand video distribution thanks to its support for advanced features.
featured image - Optimizing Video Streaming with DASH Protocol
KARTIK SAIN HackerNoon profile picture

The DASH (Dynamic Adaptive Streaming over HTTP) protocol is an increasingly popular video streaming technology that has come to the fore in recent years. It offers a flexible and efficient solution for delivering multimedia content over the internet, enabling content providers to optimize the delivery of their content to a broad variety of devices with varying network conditions.


Disclaimer: This article was edited for grammar and clarity using the para rephrase AI tool.


DASH was developed by the Moving Picture Experts Group (MPEG) to succeed the HTTP Live Streaming (HLS) standard. It's a highly versatile and adaptive video streaming solution because it works with any video codec, container type, or streaming server and is used by OTTs.


One of DASH's greatest strengths is its ability to instantly adjust to changing network circumstances. It does this by cutting the video into short, often 2- to 10-second chunks. These chunks are encoded at several quality levels so that the client can choose the most suitable one depending on criteria like bandwidth, device capabilities, screen size, and personal preference whereas earlier some concepts of tracking bandwidth are applied and OTT tries to achieve some solutions with it.


DASH uses a manifest file, usually an XML file, to describe the available video chunks and their quality. The manifest file may also include metadata such as closed captions, alternate audio tracks, and audio and video codecs. The client application takes this data into consideration when choosing which portions to play and when switching between quality settings.


DASH's key benefit is that it works with various streaming servers and content delivery networks (CDNs). Distributing content over numerous servers and CDNs improves availability, scalability, and performance for content providers. DASH is flexible and can be used for both live and on-demand video distribution thanks to its support for advanced features like encryption, content security, and digital rights management (DRM).


DASH is supported by a vast array of devices and platforms, such as web browsers, mobile devices, smart TVs, and game consoles. Additionally, it is supported by the majority of major video streaming platforms and content delivery networks, making it a popular option for both small- and large-scale video streaming applications.


A potential disadvantage of DASH is its complexity, which can make installation and configuration difficult. To attain optimal performance and user experience, careful planning and optimization are needed. Nonetheless, numerous content providers and streaming platforms have developed tools and services to facilitate the DASH implementation process.


Conclusively, the DASH streaming protocol is a highly flexible and versatile solution for video streaming, offering real-time adaptation to changing network conditions as well as support for a broad variety of devices and platforms.


Its open standard and support for multiple servers and CDNs make it a popular choice for applications of all sizes that transmit video. To obtain optimal performance and user experience, however, its complexity requires careful planning and optimization.


Here is an example of a DASH manifest file in XML format:


<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-main:2011">
  <Period start="PT0S">
    <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1">
      <Representation bandwidth="540000" codecs="avc1.4d401f" height="360" width="640">
        <SegmentTemplate media="$RepresentationID$/$Number$.mp4" initialization="$RepresentationID$/init.mp4" timescale="90000" duration="900000" startNumber="1" />
      </Representation>
      <Representation bandwidth="1080000" codecs="avc1.4d401f" height="540" width="960">
        <SegmentTemplate media="$RepresentationID$/$Number$.mp4" initialization="$RepresentationID$/init.mp4" timescale="90000" duration="900000" startNumber="1" />
      </Representation>
      <Representation bandwidth="2160000" codecs="avc1.4d401f" height="720" width="1280">
        <SegmentTemplate media="$RepresentationID$/$Number$.mp4" initialization="$RepresentationID$/init.mp4" timescale="90000" duration="900000" startNumber="1" />
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1">
      <Representation bandwidth="128000" codecs="mp4a.40.2" audioSamplingRate="44100">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <SegmentTemplate media="$RepresentationID$/$Number$.m4a" initialization="$RepresentationID$/init.mp4" timescale="44100" duration="220500" startNumber="1" />
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>


Two different modification sets are defined in this manifest file; one is for video, and the other is for audio. Every adaptation set has at least one and often several representations, all of which are of varying degrees of excellence. The URL template for obtaining the individual video and audio segments is specified by the SegmentTemplate element. Additionally, the initialization URL that is specified by this element is used to access the initialization segment.


Support for Closed Captions within DASH

Closed captions are a type of subtitle that is based on text and is synchronized with the video content. DASH is able to facilitate the delivery of closed captions. There are many different protocols that can be used to provide closed captions, including WebVTT, TTML, and CEA-608. The DASH manifest file may contain additional AdaptationSets for various closed caption tracks. These AdaptationSets may each have their own URL template that allows users to access the closed caption portions.


An illustration of a closed caption AdaptationSet can be seen, for instance, in the DASH manifest file represented by the following XML code snippet:


<AdaptationSet mimeType="application/ttml+xml" lang="en-US">
  <Representation bandwidth="128000" codecs="ttml" id="cc1">
    <SegmentTemplate media="cc1/$Number$.ttml" initialization="cc1/init.mp4" timescale="1000" duration="2000" startNumber="1"/>
  </Representation>
</AdaptationSet>


This AdaptationSet outlines the parameters for a closed caption recording that uses the TTML file format and is intended for the English (US) language. When it comes to the caption track, the bandwidth, codecs, and section template are all determined by the Representation element.

Support for Thumbnails within DASH:

The delivery of thumbnail images is also supported by DASH. Thumbnail images are miniature preview images that can be presented either before or during the playback of a video. You have the option of providing thumbnails in the form of separate image files or as an integral component of the video segments themselves. It is possible for the DASH manifest file to contain additional Representations for a variety of thumbnail tracks, each of which has its own URL template for retrieving the thumbnail segments.


An illustration of a miniature representation in a DASH manifest file can be seen, for instance, in the XML code fragment that is presented below:


<AdaptationSet mimeType="video/mp4" contentType="video" segmentAlignment="true" startWithSAP="1">
  <Representation bandwidth="150000" codecs="avc1.42C015" id="thumb">
    <SegmentTemplate media="thumb/$Number$.jpg" initialization="thumb/init.mp4" timescale="1000" duration="2000" startNumber="1"/>
  </Representation>
</AdaptationSet>


The JPEG file format is used for the thumbnail component that is specified by this representation. The initialization URL and the thumbnail segment URL template are both specified by the SegmentTemplate element. The thumbnail segment URL template is used to access the thumbnail segment, and the initialization segment URL is used to access the initialization segment.


DASH allows for the delivery of closed captions and thumbnails, both of which have the potential to improve the overall watching experience as well as supply additional context and information related to the video content. The DASH manifest file may contain supplemental AdaptationSets and Representations for a variety of caption and thumbnail tracks, each of which may have its own URL template for accessing the relevant portions.



The featured image for this article was generated with Kadinsky v2.

Prompt: Illustrate a video stream.