video & live streaming

What Is HLS (HTTP Live Streaming)? How HLS Works?

What is HLS (HTTP Live Streaming)?

HLS (HTTP Live Streaming) is a HTTP-based streaming communication protocol which is developed by Apple to deliver both live and on-demand stream. It allows a receiver to adapt the bit rate of the media to the current network conditions in order to maintain uninterrupted playback at the best possible quality.
HLS is a quality streaming technology that is widely supported in streaming from vendors like Adobe, Microsoft, RealNetworks, and Wowza. It also supports real-time transmuxing process in distribution platforms like Akamai.

How HLS works?

Apple originally developed http live streaming technology to allow content providers to send live or prerecorded audio and video to Apple devices using an ordinary Web server. Figure 1 shows the general structure of HLS Protocol.

HLS (HTTP Live Streaming) protocol
Fig 1: System Architecture of HLS (HTTP Live Streaming) protocol

After the media is encoded, it is segmented through a stream segmenter. The stream segmenter segments the media data, which is received with respect to a fixed time interval, generates a segmented file, and then generates a playlist file of metadata (.m3u8) through which the segmented file can be accessed from client devices. Live streaming requires storing data in real-time; thus, segmenting media data through a segmenter is not required. Instead, segmented streaming data can be produced based on a predetermined duration of a media segment which is then stored.

HLS (HTTP Live Streaming) Master Playlist
Fig 2: Master Playlist with multiple encoded files

The playlist file, which has an m3u8 file extension, has at least three types of TS files in MPEG-2 media format. Users download an extended M3U playlist file which contains several URIs corresponding to media files. Each individual media file must be formatted as an MPEG-2 TS. For continuous live streaming, the playlist must be updated with the production of the MPEG-2 TS file together with the produced URIs.

Advantages of HLS Protocol

Transmitting of media content via the HLS technology has the following advantages:

  • Content is transmitted via HTTP. This is an auxiliary Internet protocol. In this case such solution works in any place with available Internet.
  • HTTP does not require some complicated customizing of ports comparing, for example, with RTSP or RTMP customizing.
  • Data received via HTTP is transmitted via external companies firewalls easily.
  • HLS supports adaptive bitrate for both live video and video on demand (VOD). For this, each viewer can receive the best quality stream for their internet connection at any given moment.
  • HLS supports media encryption and user authentication.
  • HLS has ubiquitous support on a variety of browsers, mobile phones, and operating systems.
  • Free Apache or nginx can be used as web servers. HLS does not require purchasing Adobe Flash Media Server, Wowza Server.

HLS is an adaptive streaming technology to communicate with iOS and Apple devices. It provides a reliable, cost-effective means of delivering continuous and long-form video over the internet.