HTTPS Live Streaming

What is HLS?

HLS, short for HTTP Live Streaming, is a streaming protocol developed by Apple to deliver video streams over HTTP. It works by splitting the video stream into small chunks that the player can fetch on by one.

HLS is currently the dominant streaming protocol, replacing RTMP that was used by Flash players. It has the widest support and better support from players than other options.

The full HLS specifications can be found here

How Does it Work?

HLS takes a continuous live stream, and breaks it into a series of video "chunks" that can be downloaded individually.

There are 3 steps in the playback process. First, the player fetches the stream URL, which returns the playlist (playlist.m3u8). The playlist has entries for each available bitrate, and a link to the chunklist for that bitrate. The player selects a bitrate, and downloads the chunklist.

The chunklist is another m3u8 file, but one that changes regularly. The playlist does not normally change of the course of the stream, but the chunklist updates every time there is a new video chunk. The chunklist contains the last several chunks, depending on the buffer settings, which gives the player some video chunks to play.

The player will then download the video chunks, and play them in sequence. By regularly re-fetching the chunklist, the player will see new chunks in the list and download them, allowing for continuous playback.

Tuning HLS

The chunk size and number of chunks in the buffer have an impact on the stream performance. There is no universally best setting, since everyone's use case is different.

The chunk size affects the amount of video in each chunk. Larger chunks are more efficient on bandwidth, since the amount of overhead per second of video is less. Shorter chunks are quicker to download, meaning the player can start showing video sooner.

The chunk size may only be a multiple of the keyframe rate, so shorter chunks require a matching keyframe rate. Please refer to the live stream tuning documentation for the impact of the key frame settings.

The number of chunks in the list affects the buffer time. The size of the buffer is chunk size * number of chunks. A longer buffer makes the stream more resistant to network issues, but increases the latency, which may be undesireable.

By default, we set your chunklist to 4 chunks of 8 seconds each. We find this gives a good bitrate efficiency and resistance to network issues. This does cause ~30s latency on streams. For users desiring lower latency, a list of 4 4-second chunks will offer ~15s latency, and for those desiring as close to realtime, lists of 3 2-second chunks will offer < 10 second latency. This reduced latency is at the cost of stream reliability, and lists with less than 3 chunks or 2 second chunks will likely not work well.

Please Contact us, and we'll get your streams set up just right for you.

Streaming in the Age of SSL Security

Providing secure HTTPS delivery of your HLS streams is essential if you are to reach your audience. The Chrome browser update requiring HTTPS was a big driver of this shift in the streaming industry, but we have been supporting HLS over HTTPS since 2015. All TV apps require streams to be delivered over HTTPS, on Apple and Google TV and Amazon Fire. Most in browser HLS is being delivered over HTTPS as browsers block mixed content.

With content increasingly consumed on Smart TVs, HTTPS delivery of streams has become a necessary part of your video streaming package. Providing secure HTTPS connections to our full CDN is included with all ScaleEngine video streaming services, and is now the default for our players.