51.8% of the one million most visited websites around the world, use HTTP. Other studies have different numbers, but the underlying point is that HTTP is a famous protocol, and it’s a no-brainer that video streaming over HTTP (HTTP Live Streaming or HLS) is one of the most commonly used video streaming protocols. Bitmovin’s report cites HLS to make up 79% of all video streaming. Popular or not, that’s another debate. It still leaves us with the question; what is HLS streaming? Why use it and how does it work?
What is HTTP Live Streaming (HLS)?
HTTP Live Streaming (HLS) is a video streaming protocol that was launched by Apple in 2009 along with the unveiling of its iPhone 3.0. It was primarily created to reduce dependency on Flash. This is because HLS delivers video using the Hypertext Transfer Protocol (HTTP), and hence can be served or cached using any ordinary web server and can be played by an HTML5 player.
It’s a widely used protocol mainly because it can run on any web server and can be played on any device. It also allows for adaptive bitrate streaming, where the stream quality can be adjusted according to changing bandwidth conditions.
HLS is even more widely used than a few modern streaming protocols such as P2P. For instance, P2P streaming requires a specialized setup, as end-user devices need to keep TCP or UDP ports open through NAT and firewalls. This is not the case with HLS - it is simple and allows users to view videos through any browser or any device.
HLS delivers video using the TCP transport protocol, which involves setting up a formal connection with the end-user device before video streaming starts. This helps ensure that no video frames are lost in transit. However, the use of TCP is one of the reasons for the slower delivery of video through HLS. As opposed to the UDP transport protocol, which is faster but less secure.
Is HLS Just for Live Streaming?
Despite live streaming being part of its name, HLS is used for both live and on-demand video streaming. In the case of live streaming, videos are encoded into streams in real-time and served to client devices. In on-demand streaming, the videos are stored in pre-encoded formats and delivered through a server when a client device initiates a request to view it.
How Does HLS Video Streaming Work?
HTTP Live Streaming (HLS) can be considered as breaking down videos into smaller chunks. Each of these byte size chunks can then be requested by the end-user device from the server.
- Videos are first encoded into a codec that end-user devices can interpret – H.264 for video and AAC or MP3 for audio in the case of HLS.
- The videos are converted into duplicate streams of varying qualities (240p, 360p, 480p, 720p etc.).
- Videos are then segmented into small 10 second portions or less.
- An index file (.M3U8 file or manifest file) is created that allows the end user device to compile the chunks in order.
Pros and Cons of HLS Video Streaming
Following are the pros and cons of HLS in comparison to other video streaming protocols:
- Support on All Devices: Since streaming takes place over HTTP, the video can be easily played through any device on any modern browser.
- Support on Most Network Infrastructure: HLS videos can be served from any ordinary web server, and hence can be cached on a CDN or HTTP caching appliance.
- Adaptive Bitrate Streaming: HLS allows for switching between different renditions of a video on the player’s end, and you don’t need a server to do this switching. The player switches between high and low bandwidth depending on the bandwidth condition, and this way users experience minimal or no buffering.
- No Complexity at the Users’ End: Unlike P2P streaming that requires separate applications and the user’s device to keep TCP or UDP ports open, HLS runs simply through a browser.
- High Quality: As HLS uses TCP for transport, no video frames are lost in the delivery. Hence, you won’t notice any distortion and the video will play smoothly.
- More Secure: As HLS uses TCP for transport, it’s much better safeguarded against DDoS attacks. Streaming can also take place under a secure HTTPS layer.
- Scalable: As HLS is widely supported on most network infrastructure, if you are using cloud streaming technologies, then you can easily scale up servers and caching appliances. This can help solve bandwidth challenges and network congestions if there is a rapid surge in viewers.
- Latency: One of the greatest drawbacks of HLS is its high latency when you use it for live streaming. This is because of the multiple processes that take place between the recording of a video and finally delivering it in HLS to an end-user device. Some video platforms use multiple techniques to optimize and provide low latency live streaming. Examples of such techniques include reducing chunk size or utilizing the new low latency HLS from Apple.
- Efficiency: HLS involves each end-user to fetch the video from the origin server or caching server. This is not the most efficient mechanism to fetch a video and may cause buffering. As opposed to P2P streaming that allows each end-user device to act as both client and a server, and share videos with peers.
VIDIZMO – Get Started on Streaming Through HLS
Need to stream videos using HLS, such that they are optimized to solve bandwidth challenges and play easily on any device? VIDIZMO EnterpriseTube allows you to set up your organization’s own YouTube-like portal, where you can upload videos and stream them privately with internal audiences or publicly. You can create a library for on-demand videos or carry out a live stream – with low latency HLS.
VIDIZMO EnterpriseTube is a Gartner-recognized enterprise video platform, that helps you stream videos for end-to-end video use cases. Be it training your internal employees, or sharing confidential videos with select restricted audiences, or conducting a live event, sharing it later for on-demand viewing. You can do it all through one system! Integrate it with your LMS, CMS, SSO, or ingest recorded meetings from Zoom.
We have been in the video industry for over 20 years and have been solving multiple video-related challenges for large enterprises like the US Department of State, Campari, NEC and more. We have been working constantly to help organizations deliver videos using the latest technologies. Feel free to contact us for consultation or to discuss more on how our solutions can help solve your video challenges.
References: Li, B., Wang, Z., Liu, J., & Zhu, W. (2013). Two decades of internet video streaming: A retrospective view. ACM transactions on multimedia computing, communications, and applications (TOMM), 9(1s), 1-20.