HLS & LL-HLS
Quick look-up table
HLS & LL-HLS | |
---|---|
Type of streaming | File Segmented |
Development State | Maintained |
Expected Latency | Medium (3+ sec) to High (30+ sec) |
Connection type | TCP |
Default Port | HTTP (80), HTTPS (443) |
Modern codecs | H264, AAC, HEVC |
Difficulty of read | Beginner |
Notes | * HEVC only supported in fmp4 HLS, not MPEG-TS HLS |
What do I need to know about HLS?
HLS is Apples answer to do streaming over the internet, it will work on all Apple devices. It always contains a playlist with multiple segmented media files that in total form up the stream. It can be used for both live or recorded streams, but it requires at least 3 segments before playback can begin. Most common implementations of HLS will have segments of 6 to 10 seconds, which gives it quite a delay. Since it has native support for all Apple devices the rest of the streaming world adapted to this and started supporting it as well. Now it's easily one of the most common HTTP based delivery methods for viewing streams.
HLS itself comes in two flavors, the older versions are based on MPEG-TS. The newer versions are based on fmp4 and enjoy broader support and latency options. All HLS delivery is done over HTTP(S). LL-HLS is nothing other than a higher version of HLS that has additional functionality to no longer need fully complete segments and significantly lower the latency.
When would you use HLS?
Playback that works for most devices
HLS comes with different versions and different rules per version. Each version of HLS adds functionality, but also lowers support as older devices might not support it. What you see is that most solutions using HLS use a combination of different versions to make sure device compatibility is ensured, while also offering additional features of higher HLS versions.
The scheme for HLS looks like this:
http://ADDRESS:PORT/path/index.m3u8
The PORT
is the HTTP(S) port in use by the server.
The only other thing you need to know about the HLS scheme is that you direct the connection towards the index.m3u8
that contains the information for all tracks and segments that make up the stream. The path
is fully dependant on how the server has made up the pathing to get to the streams.
Things that are handy to know about HLS
- The main playlist (The first
index.m3u8
) can contain more indexes. This is often done to make a multibitrate stream with multiple video qualities. You can however also only give one of these secondary playlists to create a single quality only. - High latency is a common problem for HLS, tricks to lower it is to target a segment size of 2s and/or go to LL-HLS, which will lower it to more manageable latency.
- Storing media ready for HLS could mean you need to store your streams segmented as well. Luckily you can void this with media servers such as MistServe.
Advantages of HLS
- Broad playback support
- Several versions to ensure compatibility
- Options to make lower latency an option
Disadvantages of HLS
- No native browser support unless on a device by Apple
- High latency by default
- Storing files for HLS format can get complicated fast
How do you get started with HLS?
Starting with HLS can be as simple as setting down a player, luckily with MistServer also comes a meta-player that is capable of doing HLS. Why don't you download MistServer and try it out right away!