HLS, MPEG-DASH, and MP4
Gcore Video Streaming allows you to deliver video-on-demand (VOD) content optimized for different devices and platforms. We offer multiple video formats as part of the service, so you’re not limited by the technical constraints of a single playback option and can choose a format that best fits your use case and functional requirements.
We offer the following formats for playback:
-
HLS TS : A default VOD delivery to all devices. Has codecs limitations. For instance, it supports H264 video codec up to High Profile level 4.1 but using newer codecs like H265 and AV1 isn’t possible.
-
HLS CMAF : A common format supported by all modern devices (e.g., iOS 10 and later). Supports a fragmented MP4 (fMP4) format of video chunks that allows using a wide range of modern technologies such as new H265 and AV1 codecs.
-
MPEG-DASH : A popular video delivery format with the advantages of a universal single manifest. It provides buffer-based (BOLA) and hybrid (dynamic) bitrate adaptation algorithms and natively supports all modern codecs. Most preferred on Android and Windows platforms.
-
MP4 : A format for downloading videos as a single file in an MP4 container. Used when a user doesn’t just want to watch a video but download it locally, for example, for editing.
You can also find a description of supported video formats and relevant use cases in our API documentation.
HLS TS and CMAF formats
The HTTP Live Streaming (HLS) format is the most common format for delivering videos online. This format allows you to:
- Use adaptive bitrate. This provides viewers with video content at a quality level determined by the speed of their internet connection.
- Slice into chunks. Video content is chunked into segments from 2 to 6 seconds and cached for fast delivery worldwide using CDNs.
- Protect content from unauthorized use. HLS supports AES-128 encryption and is compatible with major DRM (Digital Rights Management) systems. This ensures secure delivery and controlled access to video content.
The hls_url
contains a URL to the manifest (.m3u8) that tells players the order in which they should play the chunks into which the video is divided.
The hls_cmaf_url
contains a URL to the master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. The chunks are in the fMP4 container, which is codec-agnostic and allows the use of anything like H264, H265, or AV1.
Considering the existing limitations of the old HLS, it’s important to understand how the manifest and chunks will be formed. Chunk type is selected automatically according to the used type of video codec:
-
master.m3u8:
- MPEG TS if the video was encoded in H264 only.
- CMAF if the video was encoded in additional HEVC and AV1. CMAF is used because Apple devices don’t support HEVC/AV1 over MPEG TS and aren’t standardized in TS-container.
-
master-cmaf.m3u8 will always contain CMAF chunks for any video codec.
Here is the full possible format of the link to get the master manifest:
Where:
{client_id}
: Your account ID.{video_slug}
: Slug identifier of the video.[-cmaf]
: The HLS CMAF version of the manifest. For details, check the hls_cmaf_url field description in our API docs.[-min-N]
: Special suffix that specifies the lowest video quality limit available in an Adaptive Bitrate (ABR) streaming. Learn more about the setting in the Limit quality section.[-max-N]
: Special suffix that specifies the highest video quality limit available in the ABR streaming. Learn more about the setting in the Limit quality section.[-img]
: The trick play feature for Roku devices allows thumbnail images to be embedded directly into the manifest. Read more in the article Timeline hover previews: use with players and Roku devices.[-(h264|hevc|av1)]
: Video codec soft limitation. Applicable if the video was simultaneously transcoded into multiple codecs (264, H265, and AV1) and you want to return just one video codec in a manifest.
For example, check out the following manifest links for a master playlist:
-
The link to the master playlist: https://demo-public.gvideo.io/videos/2675_FnlHXwA16ZMxmUr/master.m3u8
-
The link to the master playlist with CMAF-based chunks: https://demo-public.gvideo.io/videos/2675_FnlHXwA16ZMxmUr/master-cmaf.m3u8
DASH format
Dynamic Adaptive Streaming over HTTP (DASH) is the industry standard video format that’s widely adopted by streaming services and supported on most non-Apple devices and browsers.
This format allows you to:
-
Use adaptive bitrate. You can stream videos of different quality and switch in the middle of a video from one quality level to another.
-
Support for multiple DRM systems. DASH is compatible with various Digital Rights Management (DRM) systems, allowing for the secure distribution of media across different platforms.
-
Deliver content encoded in different formats. DASH is designed to work with a wide range of audio and video codecs, which ensures seamless playback across different devices and platforms.
Video content delivered in DASH format contains a manifest file (.mpd). This file informs players about the video structure (chunks and segments), available quality levels and bitrates, and the order and conditions under which each video chunk should be played.
For DASH, chunks will also differ depending on the type of video codec that was used to encode the quality:
- CMAF chunks for H264 and H265 video codecs
- WebM chunks for AV1 video
Example of the WebM output:
Here is the full possible format of the link to get the master manifest:
Where:
{client_id}
: Your account ID.{video_slug}
: Slug identifier of the video.[-min-N]
: Special suffix that specifies the lowest video quality limit available in an Adaptive Bitrate (ABR) streaming (same behaviour as for HLS). Learn more about the setting in the Limit quality section.[-max-N]
: Special suffix that specifies the highest video quality limit available in the ABR streaming (same behaviour as for HLS). Learn more about the setting in the Limit quality section.[-(h264|hevc|av1)]
: Video codec soft limitation. Applicable if the video was simultaneously transcoded into multiple codecs (264, H265, and AV1) and you want to return just one video codec in a manifest.
Info
ABR soft-limiting of video quality isn’t available for DASH format.
Example of the manifest link:
https://demo-public.gvideo.io/videos/2675_FnlHXwA16ZMxmUr/master.mpd
MP4 format
Video can be streamed and downloaded using the .mp4 file format when you want to handle the whole file at once instead of in chunks. MP4 format allows users to:
- Watch videos offline on mobile devices
- Download video files for local modification
- Play videos even on very outdated devices
- Share videos on social networks and other streaming services
- Content can be protected with Secure Token. DRM protection isn’t supported.
When using the MP4 format, users can work with each available video resolution separately. For example, select the video quality version (720p) and download only that version: https://demo-public.gvideo.io/videos/2675_FnlHXwA16ZMxmUr/720.mp4
Example usage:
Gcore supports regular download requests for entire MP4 file downloads. We also support range requests specifying the HTTP “Range” header.
Tip
You can protect MP4 files with the Video protection via the Security Tokens feature.
Get HLS, DASH, and MP4 links
You can get links to videos in two ways: in the Gcore Customer Portal or via the API.
Customer portal
1. In the Gcore Customer Portal, navigate to Streaming > Video Hosting.
2. Open the video for which you want to export the link.
3. In the Links for the export section, copy the relevant link:
- Video page URL : A Web player URL to access and play the video directly from a website.
- HLS : A URL to a master playlist HLS (master.m3u8) with MPEGTS container.
- iFrame embed code : A URL to our HTML video player with the video inside. It can be inserted into an iframe on your website and the video will automatically play in all browsers.
API
To get information about the video, call a method:
Example request:
Example response:
Where:
iframe_url
contains a web player linkiframe_embed_code
contains web player embed codehls_url
contains the HLS linkhls_cmaf_url
contains the HLS link with CMAF chunksdash_url
contains the MPEG-DASH linkmp4_url
contains the MP4 link
Limit the lowest and highest quality in HLS adaptive bitrate
The manifest file (.m3u8) for HLS and HLS CMAF, and manifest (.mpd) for MPEG-DASH streaming contains all possible video qualities by default. If you want to limit the quality for old devices, non-paying users, or a quick view, you can specify a suffix indicating the minimum and/or maximum allowed resolution:
-min-N
: minimum resolution not less than specified-max-N
: maximum resolution not exceeding than specified
N
is a resolution (height or width) from 240 to 9999. If the video is horizontally oriented, the resolution is its height. If it’s vertically oriented, it should be width.
Here’s an example of how to get two qualities only—360 and 480—instead of the full set for HLS (the same can be done for MPEG-DASH manifest .mpd):
The response is: