HTTP Live Streaming
What is HTTP live streaming?
HTTP Live Streaming (HLS) is a technology, developed by Apple, for streaming live and on demand video. Although HLS was initially developed for delivering video content to iOS devices, it has since been extended to support other devices as well. HLS uses the HTTP protocol which enables users to stream media from their regular web server instead of using a specialized streaming server.
HLS is adaptive in that the video quality is adjusted for a user based on their bandwidth capacity. This is beneficial primarily for users who don't have a strong internet connection. These users would then be delivered a lower quality version of video which allows them to continue watching without waiting for the video to buffer.
How HLS works
HLS works by splitting live streams into smaller HTTP-based files. The manifest file (file with a .m3u8
extension) contains multimedia playlists and references to the actual video fragments called TS files. Multiple playlists are created for the various devices and differing bandwidth connections that access the stream.
HLS features
HLS offers many useful features that make it a popular choice in streaming live and prerecorded video. According to the Mac Developer Library the following outlines what HTTP Live Streaming offers in terms of usability, customization, and security.
- Fast forward and reverse playback: Both fast forward and reverse are supported in HLS with the use of an I-frame playlist.
- Content protection: By using sample-level encryption, media segments can be individually encrypted offering greater security.
- Ad insertion: The ability to insert ads is available in HLS through the use of discontinuity markers.
- Closed captions and subtitles: HLS supports the use of closed captions embedded in the MPEG-2 transport stream and subtitles in WebVTT format.
- Alternate audio and video renditions: The use of multiple audio renditions (e.g French, Spanish, German language soundtracks) and video renditions (e.g different angles for a sporting event) are both supported.
- Fallback and stream alternatives: The alternative media playlists serve to deliver different quality content to different users and devices but also serves as a fallback in case of failure. In the event a playlist isn't able to load, the player will attempt to serve an identical playlist from another server.
- Timed meta data: Whether you want to insert album art to an audio stream or a player's name to a sports game stream, timed meta data allows HLS users to do so.
Difference between live streaming and on demand streaming
Contrary to what the name implies, HTTP Live Streaming is suitable for streaming both live and on demand videos. Live streaming means the video is being recorded in real time and the viewer must watch the broadcast as it is streaming, otherwise they will only be able to view it if it is release later on demand. On demand streaming is the streaming of prerecorded video allowing users to re-watch the video as many time as they would like.
Summary
Live streaming has made some great advancements in the past few years as far as accessibility, usability, security, and configuration abilities. HTTP Live Streaming plays a big part in these advancements especially for mobile devices as it allows for these devices to access live media efficiently and seamlessly. With 80% of Internet users owning a smartphone, using HLS to stream live content can be beneficial for both you and your viewers.