HLS Streaming Pros and Cons | Your Engineering Guide

  • AS Team
  • Sep 29, 2023
HLS Streaming Pros and Cons | Your Engineering Guide title banner

Developments in the 2020s in social networks have shown a new perspective on video streaming. Both the video quality and the stability of live streams are of higher quality, and the options for interaction are better. Thanks to faster internet connections and better compression technologies, live streams can now be broadcast in higher resolution and with less delay. This has resulted in an overall better user experience.

 

But there is also progress on the part of the creators: the monetization of live streams. Platforms have introduced various ways for content creators to make money. These include subscription models, donations, brand collaborations, and ads. More and more people are using live streaming as a source of income due to these developments.

 

Consequently, platforms want to establish advanced video functions in order to remain attractive in the market. For example, the podcast platform Spotify now increasingly supports videos.

 

What is HLS?

 

HLS (HTTP Live Streaming) is an HTTP-based communications protocol for streaming media, developed by Apple as part of QuickTime, Safari, OS X, and iOS software. It is based on the principle of splitting an entire stream into small parts that are downloaded one by one over HTTP. The stream is continuous and could theoretically be endless. 

 

An advantage of HLS is that all internet-connected devices support the HTTP protocol, making it easier to implement than streaming protocols that require dedicated servers. Another advantage is that HLS streaming can increase or decrease video quality depending on network conditions without interrupting playback. 


 

How does HLS work?

 

HLS is an important protocol for live streaming. The process of live streaming looks something like this:

 

  • Capture devices (cameras, microphones, etc.) capture content.

  • The content is sent from the capture device to a live video encoder.

  • The encoder transmits the content to the video hosting platform using the RTMP protocol.

  • The video hosting platform uses HLS ingest to send the content to the HTML5 video player.

  • This process requires two basic software solutions: an HLS encoder for live video and a powerful video hosting platform. If you decide to stream video using HLS, you need to make sure that both software solutions offer the mentioned protocols and features.

 

HLS architecture

 

HLS uses a standard web server to distribute video on demand but requires special software to enable real-time streaming of content.

 

Server part

 

Encodes and converts incoming media into a format suitable for delivery. The material is then prepared for distribution by segmentation. The media is divided into chunks and an index (playlist) file. Encoding: Video is encoded in H.264, and audio in MP3, HE-AAC, or AC-3. All this data is inserted into an MPEG-2 transport stream that will be delivered later. Segmentation: Content in MPEG-2 TS is segmented into sections of equal length and written to .ts files. An index file is also created containing references to slices or other index files.

 

Distribution

 

The server works like a standard web server, accepting requests from clients and providing everything needed for playback.

 

Customer

 

Requests and downloads all files to provide the user with a continuous video stream. The client software downloads the first index file via a URL, followed by several available media files. The playback software puts everything together in a sequence to play it. There are two HLS modes of operation - on-demand and live streaming. In on-demand mode, the playlist contains links to all fragments, from the first to the last. In live mode, the playlist refers only to the latest fragments, and the fragments change from patch to patch, reflecting the current status of the broadcast.

 

HLS supports adaptive bitrate, a technique where multiple simultaneous streams with different content encoded at different bitrates and also with different characteristics can be available. During playback, the client can choose between several available streams, allowing the session to adapt to external network transmission conditions.

 

Conclusion 

 

HLS streaming offers numerous advantages, such as high quality of the transmitted content, easy implementation in websites and applications, and good scalability. If you want to build a software solution that will have an HLS streaming feature, you’ll need an experienced software engineering team. Get acquainted with the HLS streaming Android development.

 

Also, the HLS protocol continues to evolve. Apple developed the LHLS extension - it allows you to achieve a delay of less than 2 seconds. In the future, this modification will be supported by almost all players and mobile devices.

Latest Comments