Support

Find answers, guides, and tutorials to supercharge your content delivery.

MPEG-DASH - Dynamic Adaptive Streaming Over HTTP Explained

Published on March 4, 2022
MPEG-DASH - Dynamic Adaptive Streaming Over HTTP Explained

Streaming is a way of delivering content over the internet that allows users to consume the content before it has finished downloading. Streaming is a widespread way of delivering audio and video content. Broadcasters, publishers, entertainers, and other professionals in these fields can use streaming to deliver their content online without having to worry about large downloads taking place or connection disruptions.

If you're looking to start streaming video content on your website, you'll need to decide which streaming protocol to use. A few different options are available, but the most popular ones are MPEG-DASH and HLS. In this blog post, we'll compare these two protocols and help you decide which one is right for you.

What is MPEG-DASH?

MPEG-DASH, or Dynamic Adaptive Streaming over Hypertext Transport Protocol (HTTP), is a streaming protocol developed by the Moving Picture Experts Group (MPEG). It's an international standard and delivers video content over the internet.

MPEG-DASH is a versatile streaming protocol that can deliver video content in multiple audio and video formats. The content is delivered in small "chunks" or segments, with each segment being played back at the same time as it's downloading. This reduces buffering issues that are common when streaming over a slow connection.

MPEG-DASH utilizes adaptive bitrate streaming, meaning that if a user has an unstable internet connection, MPEG-DASH will adjust the quality of the video stream to match their connection speed. This prevents buffering issues from occurring or makes them less likely to occur.

What is adaptive bitrate streaming?

Adaptive bitrate streaming is a feature of MPEG-DASH (and other kinds of streaming) that adjusts the quality of the video stream to match the user's connection speed. It involves producing multiple files at different bitrates and then streaming the one that is best suited for the user's connection. This prevents buffering issues from occurring or makes them less likely to occur.

The reason that adaptive bitrate streaming is so important is that it allows content providers to serve a wider range of users. If all the videos on a website were streamed at the same bitrate, users with slow connections would have trouble streaming them. By using adaptive bitrate streaming, providers can serve these users by lowering the quality of the video stream while still delivering a good experience for users with faster connections.

For example, say you have an HD video streamed on your site at a constant bitrate of 4000kbps. If your user has a slow connection, they may experience buffering issues because the quality of their stream will be too high for their internet connection to handle without causing buffering. This is where adaptive bitrate streaming comes in handy: if you stream the same video at a bitrate of 2000kbps instead, it will be more suitable for users with slow connections.

This is especially useful if you want to stream video content at different resolutions (for example, Full HD and 720p) because it gives your users the option of choosing which resolution they prefer. Most streaming sites can offer this flexibility because of adaptive bitrate streaming.

How MPEG-DASH works

For MPEG-DASH to work, you need two things: A MPEG-DASH player and MPEG-DASH files. The MPEG-DASH player is a software program that will play the video files back for your users. Examples of MPEG-DASH players include JW Player, FlowPlayer, and Bitmovin.

The MPEG-DASH files are the video files themselves. These will be stored on your server and can be accessed by your users through their web browsers or mobile devices. The player software programs listed above all support MPEG-DASH but web browsers do not support MPEG-DASH directly. The way that you set up your video files will depend on which player you use, but there are some common features across all of them:

  • Video files can be stored in any format (MPEG, AVI, MOV, etc.)
  • They have different bitrates for the same video file at different resolutions (for example, 480p, 720p, and 1080p)
  • They are segmented into small files that can be downloaded and played back simultaneously

MPEG-DASH streaming

The main steps in the MPEG-DASH streaming process are as follows:

Encoding

The content is encoded into multiple files with different bitrates in the first step. Then, they are segmented into smaller segments that are a few seconds each in length. These files can be either video or audio. The origin server then sends the files to a content delivery network (CDN), where they will be stored.

Delivery

When the user begins watching or listening to the stream from the CDN, it will then download the segments of the stream that have not been downloaded yet and send them to the user's browser. If there is a segment that the user has already watched, it will be skipped and not downloaded again.

Playback

The user's browser will then play the segments back as they are downloaded. This allows them to start watching or listening to the content before it has finished downloading. If the connection is lost, the browser will resume playback from where it left off when the connection is restored.

MPEG DASH manifest

The MPEG-DASH manifest describes what type of content is being streamed and how it should be played back by the client software. The manifest file contains information about each segment, such as how long it is and its format. It also contains a list of all the segments that make up the entire video or audio stream.

Player software

To play MPEG-DASH content back, the user needs to have player software supporting the protocol. There are several different players available, both free and commercial. A few popular ones are Microsoft Edge, Safari, Chrome, Firefox, and VLC.

Implementations

MPEG-DASH is available natively on:

  • Android through ExoPlayer
  • Samsung Smart TVs
  • LG Smart TVs
  • Sony Smart TVs
  • Chromecast
  • YouTube
  • Netflix

While there is no direct support for MPEG-DASH in HTML5, JavaScript libraries can be used to implement it using the HTML5 Media Source Extensions. These libraries include dash.js and shaka-player.

Creating MPEG-DASH files

Creating MPEG-DASH files is not as difficult as it may seem. There are a couple of different ways that you can do it:

  • Use an online video converter
  • Convert them yourself using Handbrake or another software program that supports MPEG-DASH encoding (this is the best option as it will give you more control over your files)

Example of how to create MPEG-DASH files with Handbrake:

  1. Download and install Handbrake on your computer.
  2. Open up Handbrake and configure it to create MPEG-DASH files. You can do this by going to the Video tab, selecting MPLS from the Codec dropdown menu, and checking off "Enable Web optimized" under Options.
  3. In order for Handbrake to create MPEG-DASH files, you need to have a file already encoded in MPLS format. If you don't have one, you can download the sample video file from the Dash Industry website.
  4. Drag and drop your video file into Handbrake or click on the Source button and select it from your computer's hard drive.
  5. Click on the Video tab and ensure that MPLS is selected as the codec. You can also set any other options such as bitrate, resolution, etc., but this isn't necessary for creating MPEG-DASH files, so don't worry about it too much if you're new to video encoding.
  6. Click on the Browse button next to the Destination field and select a location on your computer where you want to save the MPEG-DASH file.
  7. Click on Start Encoding, and Handbrake will start encoding your video into a MPEG-DASH file.

This is just one example of how to create MPEG-DASH files. If you want more detailed instructions, you can find them on the Handbrake website.

How to create MPEG-DASH streams

To create a MPEG-DASH stream, you need to encode your content into multiple files with different bitrates and then segment it into smaller segments with the common extension .m4s. You can use a variety of software to do this, such as Bitmovin encoder, FFmpeg, or Telestream Wirecast. The segments can be in any format that the player software supports, such as MPEG- TS, MPEG-AVC, or AAC.

Once the segments are created, you need to create a manifest file with the common extension .mpd that describes them. The manifest can be in any format that the player software understands, such as XML or JSON. You then upload the files and manifest to a CDN, and they will be stored there.

When the user wants to watch or listen to the content, they will need to download the player software and open the manifest file. The player software will then download all of the segments required to play the content back. If there is a segment that has already been downloaded, it will not be downloaded again.

How DASH compares to HLS

HLS, or HTTP Live Streaming, is another popular streaming protocol used for both video and audio streams. It was developed by Apple in 2007 and is widely used on iOS devices.

Like MPEG-DASH, HLS works by dividing the content into a series of small files, each one lasting a few seconds. However, there are a few key differences:

File segment length

HLS segments are usually much longer than MPEG-DASH segments, typically lasting around 6 seconds. This is because HLS is designed for streaming video content, which generally has longer durations than audio content.

Number of files

HLS also generates many files, typically numbering in the thousands. This is because each segment needs to be encoded at a different bitrate, which MPEG-DASH does not do.

Platform support

MPEG does not run on Apple devices, nor does any other streaming protocol. HLS is the only kind of streaming that Apple supports. However, since it is the only kind of streaming supported by Apple, it is the best option for live streaming.

Latency

MPEG-DASH typically has lower latency than HLS, as the segments are much smaller, and there is no need to encode them at different bitrates. The exact amount of latency will vary depending on a number of factors, such as network conditions and hardware specifications.

Universal utility

Because Apple only recently developed HLS, its usability and player support are not universal as MPEG-DASH. This means that a few players are available that support HLS, whereas most major browsers and player software support MPEG-DASH. Because MPEG-DASH is the standard for most streaming protocols, it is likely to be supported by future players as well.

Which streaming protocol is right for you?

So, which streaming protocol should you use? The answer depends on your specific needs and preferences. If you need to stream video content with low latency, then MPEG-DASH could be a good choice as it will reduce buffering times by delivering segments before they are needed. However, if your content has a long duration or requires high-quality pictures and sound, then HLS may be the better option for you.

There is no definitive answer, and the best streaming protocol will vary depending on your particular situation. However, MPEG-DASH is likely to be a more versatile option than HLS but the support is limited on Apple devices.

Does KeyCDN support MPEG-DASH?

KeyCDN supports all video and HTTP Live Streaming forms, including MPEG-DASH and other streaming standards. KeyCDN offers an affordable way to deliver high-quality video content with low latency and no buffering. Check out our pricing today to see how KeyCDN can help you improve your streaming experience.

Supercharge your content delivery 🚀

Try KeyCDN with a free 14 day trial, no credit card required.

Get started
KeyCDN uses cookies to make its website easier to use. Learn more