Video trends · 7 min read

What is HLS video streaming

What is HLS video streaming and how does it work?

Every video ingested in our system is converted into a video stream - with multiple sizes and bitrates. This allows to serve the perfect video to each of your viewers. Perhaps that's all you want to know. But if you are curious about the internals of video streaming, read on!

Doug Sillars

February 19, 2021

HLS Video Streaming

HTTP Live Streaming (HLS) is the current 'de facto' streaming standard on the web. The actual web standard is MPEG-DASH, but HLS has gained widespread use, making it the predominant streaming solution in use today. When you play a video hosted at - you are watching a HLS video stream.

In this post, we'll walk through what HLS streaming is, and how it can be used to stream video, including streaming multiple video sizes and bitrates.

the <video> tag

HTML5 natively supports video with the <video> tag. The usage generally looks like:

<video {various attributes like autoplay poster, etc}>
	<source src= "video.webm">
	<source src = "video.mp4">


In the video tag, you set your attributes, and then link to the videos in the source tag. If you have multiple source tags, the browser chooses the first format it understands.

When the browser sees a video file (or the user presses play), it begins the download. There is only one version of the video being downloaded - no matter the screen size.

When the video source is larger than the screen, the phone will have to remove pixels to correctly display the video - using extra CPU and battery resources. If the video bitrate is higher than the available network connection - the video will be unable to play smoothly, and there will be stalls during the playback.

Another point to consider for longer videos: if a user seeks ahead in the video, the video will only start playing when every byte before the selected location is played.

A Video Stream

At its simplest, a video stream is created by breaking the video into smaller segments (or chunks) with extension .ts (they are often numbered to make them human readable). The order and naming of these segments are stored in a manifest file (typically with extension .m3u8)

Here is a manifest file from


The first 7 lines are header lines, describing the file. The TARGETDURATION says that each segment should be 4 seconds, and the PLAYLIST-TYPE indicates VOD, meaning video on demand.

Each segment is listed with the EXTINF 4.0000, indicating the length of the segment, followed by the filename.

Skipping ahead

As mentioned earlier - skipping ahead in an mp4 requires all video before the new point to be downloaded. If you skip to 1hour ahead in the movie - the player needs to download 60 min of video.

If you wish to "seek ahead" with a video stream, the player can calculate which segment to request next. The example above is short, but if you were to seek to t=22, the player can quickly calculate that it would be in 0006.ts, and the player could skip any .ts 'in between' that are not yet downloaded.

Multiple Video Streams

In reality, it is rare to just have one video stream inside your HLS video. You often have many different versions of the same video. Here at, each video is encoded at 240p, 360p, 480p, 720p, 1080p, and 2180p (up to the size of the original video).

Each of these formats will have a manifest file as above. But how do you differentiate between each version of the video?

The Master Manifest

The first file of the video delivered to the video player is the master manifest. It is the 'menu' that lists all of the streams available to consume:


Each version of stream gets its own entry, and they are typically ordered from lowest quality to highest. Let's look at the last 2 lines - defining the 4K stream:


The definitions include the bandwidth required to play the video (17.6 MBPS), the resolution 1080x1920, and the video codec (avc1) and the audio codec (mp4).

The second line is the link to the manifest for that stream that will list each segment's length and location.

Player Power

The details of this 'master manifest' gives the video player a lot of power. With the <video> tag, there is one 1080p mp4 that will play: poor network conditions, small screen - doesn't matter.

The player, being on the local device, knows the available screen size - so can request the proper size for the screen - eliminating transport data wastage. Never again will a device get too large a video, and have to resize the video on the fly.

The player can also track the network throughput by calculating how quickly each segment is downloaded. If the video playing is 1080p (4.8 MBPS), but all of a sudden, the network speed drops to 3.0 MBPS, the player can quickly shift to the 720p stream, which at 2.86 MBPS will still be able to play.

Video Startup

Have you ever watched a movie on Netflix, and noticed that the first few seconds had very low quality? When a stream begins, the player has no idea of the available bandwidth, so to ensure fast delivery, it often starts with the lowest resolution (240p 275KBPS). There are 2 things going on here:

1. really fast startup time.  Most connections can handle 275 KBPS, so we know the video will play.  For most connections, 275 KBPS will download VERY quickly - which means that the video will start quickly.
2. Math.  after 2 segments are downloaded - the player knows the network speed, and can jump to 1080p (or what the device can support).
list of video segments

In the image above, we see that 0000.ts and 0001.ts were downloaded at 480p, but from 0001.ts forward, we are at 1080p.

It's likely that the 2nd segment 0001.ts plays as 1080p, meaning that just 4 seconds is of lower quality. But it was delivered quickly, and quickly changed to a higher quality - making the overall experience for the end user a positive one.

So the end user sees a fast video startup (maybe a bit blurry), but the video quickly improves to a crisp video.

What's next for HLS?

For live streaming, shortens each segment to 2s. That way, if the player requires 2 segments to be buffered before playback, the delay is just 4s, not 8.

Recently, Apple has released specifications for Low Latency HLS (LL-HLS):

Now each segment can be broken into 'parts':

# This Playlist is a response to: GET

As the first comment line says, 'This Playlist is a response to: GET'.

Segments 270, 271 and 272 are 4s long, but broken into 12 'parts' of 1/3 second each. The request was for segment 273 part 2... But, alink is presented for 273 part3, this is introduced as a PRELOAD-HINT - meaning - "hey this is not ready yet, but we know its coming, so you can request it when you need it"

The segments 266 - 271 are requested in case the viewer would like to 'rewind' a few seconds- the player has access to about 15s of video 'in the past.'


Live streaming has a number of advantages over the HTML5 native <video> tag. Responsive by default, it ensures that less data is wasted by serving 'too large' video to a small screen. It is also adaptive - so fluctuations of network speed are less likely to impact playback. uses HLS under the hood. Every video creation response includes the m3u8 url for the stream (if you are using a different player), but our player link, and iframe embed link are using HLS under the hood.

Are you curious to see your video as a stream? Create an account and test in our developer's sandbox for free!

Try out more than 80 features for free

Access all the features for as long as you need.
No commitment or credit card required

Video API, simplified

Fully customizable API to manage everything video. From encoding to delivery, in minutes.

Built for Speed

The fastest video encoding platform. Serve your users globally with 140+ points of presence. 

Let end-users upload videos

Finally, an API that allows your end-users to upload videos and start live streams in a few clicks.


Volume discounts and usage-based pricing to ensure you don’t exceed your budget.