HTTP Live Streaming
Introduction To HTTP Live Streaming
What Is HTTP Live Streaming (HLS)?
HLS (HTTP live streaming) is one of the most widely used video streaming protocols. Although live streaming is included in its name, it can be used for both video-on-demand content (VOD) and live broadcast streams.
HTTP Live Streaming (HLS) breaks down video files into smaller downloadable HTTP files and delivers them using the HTTP protocol. HLS has numerous benefits. One of them, and perhaps the most important, is that all Internet-connected devices support HTTP, making it simpler to implement than streaming protocols that require the use of specialized servers.
HLS, a media streaming standard developed by Apple and released in 2009, is widely used today.
Key Benefits of HTTP Live Streaming
The main reasons for its widespread use can be summarized with the following items.
- HLS is not a streaming protocol that requires the use of dedicated HTTP servers, as all devices that can connect to the Internet support the HTTP protocol. Compared to other streaming protocols, it can be easily implemented on servers.
- Unlike other streaming formats, HLS is compatible with a wide range of devices and firewalls.
- HLS provides users with an uninterrupted streaming experience by adapting video quality depending on network conditions. The technology behind this feature is the adaptation of the bit rate according to the network conditions called “Adaptive bitrate video delivery”. In this way, users can watch broadcasts without interruption even if connection speeds temporarily decrease.
- This protocol includes a number of other key benefits, including embedded closed captions, synchronized playback of multiple streams, good advertising standards support, DRM support, and more.
- Because of the fact that the transmission takes place over HTTP, it can be easily transmitted over firewalls.
- HLS also supports user authentication and media passwords.
HLS working mechanism
Let’s explain the working mechanism of the HLS protocol through an example scenario.
An online television broadcast is intended to be delivered to end-users in 1080p and 480p qualities using the HLS protocol. Let’s explain the process of producing the publication and delivering it to the end-user, step by step, with the following scenario:
1-) A broadcast is produced on the server device where the broadcast to be delivered to the end-user will be produced or the existing broadcast will be distributed.
2-) The produced broadcast is encoded by the server. The HLS protocol uses the H.264 or H.265 extension format.
During the encoding process, the broadcast is divided into small parts and each part is encoded according to predetermined parameters such as the specified quality and duration.
In our example, the bitrate representing 1080p and 720p qualities to be transferred to the user is encoded according to the width and height parameters (scale) and the sound quality of the broadcasts.
During this process, an index file is prepared for the user, which holds these qualities and the list of encoded broadcast tracks.
An example of the master playlist where all the qualities are kept is as follows.
An example index file of one of the qualities is as follows. As it should be noted, this file contains the version in which the segments are encoded, the duration of each particle, and their order.
In fact, when the user changes the quality from 720p to 1080p while watching the broadcast, he requests the media parts of 1080p quality in the background from the server.
In summary, at the end of this step, each part of the segmented broadcast is encoded in accordance with the format used by the HLS protocol. An index file containing the names of the encoded parts is created.
3-) The media files, which are encoded and ready to be delivered to the end-user via HTTP, are kept at the origin where the end-users can access the files. The most effective way is to utilize the CDN service.
This is because the CDN service brings these files closer to users so that users who are dispersed in different geographical locations can watch the broadcast and obtain media files.
For example, when a user in Dubai wants to watch a broadcast from Turkey, he/she will lose time and effort by moving through the network indirectly.
For this reason, it is a very effective method to choose the CDN service, which brings the broadcast streams closer to the users and delivers them to the end-users quite quickly by caching.
Browsers and Devices that Support HLS
The HLS streaming protocol is also widely supported across multiple devices and browsers.
In the beginning, it was limited to iOS devices like iPhones, iPads, and the iPod Touch, but HLS is now supported by the following devices and browsers:
- All Google Chrome browsers
- Microsoft Edge
- iOS devices
- Android devices
- Linux devices
- Microsoft devices
- macOS platforms
It means that HLS is a nearly universal protocol.
Receiving the (HLS PUSH) broadcast sent with the HLS protocol:
Broadcasts sent with the HLS protocol can be pulled from their source and served to end-users.
The main point here is that the HLS broadcast sent over HTTP (PUSH) is received and served again. In this way, end users in different geographical locations can watch broadcasts from their closest points.
In the HLS protocol, it was explained above that the broadcasts are encoded after being segmented and sent over HTTP.
Webdav protocol is one of the most effective methods that can be used to take the broadcasts from the source (PULL) and serve them to the user.
Thanks to the Webdav protocol developed by the IETF (Internet Engineering Task Force), the HLS broadcast from the broadcaster can be given to users over HTTP without using additional protocols.
In this way, broadcasters save cost + resources (server, storage, infrastructure) and provide their users with uninterrupted, fast, and high-definition streams.
In live streaming, the server receives a raw and uncompressed video and compresses it using an encoder and the H.264 codec, converting it into the MPEG-2 Transport Streams format.
HLS is the most widely used streaming protocol for playback today. It is high-quality and robust. It is no longer an option for all streamers to be familiar with this protocol. Even if they don’t understand all of the technical details, they should be familiar with it.
Get in touch with us to learn more about HTTP Live Streaming Solutions in CDN and how Medianova can help you deliver the best online experiences.