MPEG DASH vs HLS Streaming

Опубликовано: 24 Март 2021
на канале: Learn with Monir
31,437
341

Video streaming is a technology that allows you to watch video content, such as movies, TV shows, and live events, over the internet. Instead of downloading a video file and storing it on your device, you can stream the video in real-time as it is being transmitted from a remote server.

To stream a video, you will need a device that is connected to the internet, such as a computer, smartphone, or smart TV. You will also need a streaming service, such as Netflix, Hulu, or YouTube, which provides access to the video content.

MPEG-DASH (Dynamic Adaptive Streaming over HTTP) is a standard for streaming video and audio over the internet. It allows you to stream video in high quality, with smooth playback and minimal buffering, even on devices with limited bandwidth or processing power.

Unlike other video streaming formats, MPEG-DASH uses a technique called "adaptive bitrate streaming," which adjusts the quality of the video in real-time based on your internet connection and device capabilities. This means that you can watch a video in high quality, with minimal buffering, even if your internet connection is not very fast.

Overall, MPEG-DASH is a flexible and efficient way to stream video over the internet, with smooth playback and high-quality audio and video.

Adaptive bitrate (ABR) video streaming is a technique that allows you to stream video over the internet in high quality, with smooth playback and minimal buffering, even on devices with limited bandwidth or processing power.

ABR works by continuously adjusting the quality of the video being streamed based on your internet connection and device capabilities. When you start streaming a video, your device will download small chunks of data, called "segments," from the internet and play them back to you in real-time.

In this tutorial, I have discussed two different adaptive bitrate streaming protocols, http live streaming or hls, and mpeg dash.
an adaptive bitrate streaming protocol is basically is a mechanism where the video quality is selected based on the bandwidth or internet speed of the client or media player used in the device. Both hls and dash are widely used streaming protocols these days. both protocols provide pretty similar features, however having some core differences in their implementations. They both handles the manifest file differently. hls streaming is supported all devices when it was released first and a proprietory protocol by Apple, where mpeg dash is the latest one being an open source protocol.

I compared the two protocol with practical example using ffmpeg to generate manifest playlist file with a sample video named classroom.mp4.


The summary of my comparison is this:

HTTP Live Streaming (HLS) and MPEG-DASH (Dynamic Adaptive Streaming over HTTP) are both standards for streaming video and audio over the internet. Both HLS and MPEG-DASH use a technique called "adaptive bitrate streaming," which adjusts the quality of the video in real-time based on your internet connection and device capabilities. This ensures that you can watch a video smoothly, with minimal buffering or stuttering, even if your internet connection is not very fast.

There are a few key differences between HLS and MPEG-DASH:

Compatibility: HLS is widely supported by media players and browsers on Apple devices, such as iPhones, iPads, and Macs.

Encryption: HLS supports encryption using the AES-128 cipher, which is widely used to protect video content from unauthorized access. MPEG-DASH supports encryption using the Widevine cipher

Segment size: HLS segments are typically larger than MPEG-DASH segments, which means that HLS may be less efficient in terms of bandwidth usage.

Caching: MPEG-DASH does not support caching on the client device.

Overall, the choice between the two may depend on the compatibility and encryption requirements of the streaming service or website, as well as the device and media player being used.


ffmpeg commad used in this video are as follows.

```

// Dash command

ffmpeg -i classroom.mp4 -map 0 -map 0 -c:a aac -c:v libx264 -b:v:0 800k -b:v:1 300k -var_stream_map "v:0,name:800k v:1,name:300k" -f dash -dash_segment_type mp4 -single_file 1 classroom_manifest.mpd

// HLS command

ffmpeg -i classroom.mp4 -map 0 -map 0 -c:a aac -b:v:0 800k -b:v:1 300k -var_stream_map "v:0,name:800k v:1,name:300k" -master_pl_name classroom_manifest.m3u8 -f hls -hls_flags single_file -hls_playlist_type vod -hls_segment_filename "classroom_%v/classroom.ts" classroom_%v/index.m3u8

```

MPEG DASH Explained:    • MPEG-DASH Streaming Explained for Beg...  

HLS vs Dash comparison:    • MPEG DASH vs HLS Streaming  

🙌 Helped with my video? Consider supporting my work! Buy me a coffee ☕ and help fuel more educational content on video compression, FFmpeg, Java, Spring Boot, and much more. Your support means the world to me!

💖 Support Me on Buy Me a Coffee: https://www.buymeacoffee.com/monirzaman


Смотрите видео MPEG DASH vs HLS Streaming онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Learn with Monir 24 Март 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 31,437 раз и оно понравилось 341 людям.