HLS Specification: The Important Tags

Onur Tuna
2 min readSep 5, 2021

Tonight I want to introduce you the most important tags in HLS specification: RFC 8216.

To begin with, I would like to briefly talk about HLS in simple terms. HLS is an Adaptive Bitrate Streaming protocol and have been introduced by Apple in 2009. Basically, it allows a video streaming to adapt the network quality momentarily. A manifest file in m3u8 format is introduced to a client. The client knows everything about the video stream then.

I’ll introduce the important tags used in manifest files since a manifest file is indeed a list of HLS tags.

#EXTM3U

This is actually the starting tag of a manifest file. It indicates that this file is an m3u8 file.

#EXTINF

The adaptive streaming require a media file to be segmented. Think, there is a movie video with a duration of 2h30m. How would you make the streaming adaptive to network conditions of the client? Here is the idea, segment this movie into small chunks with different resolutions.

This tag indicates the duration of the related segment.

#EXT-X-DISCONTINUITY

This tag indicates there is discontinuity. Now, it might come to you confusing. Think, there are chunks of the movie and you want to add a random advertisement between some two chunks. How would you do that? There is a solution with this tag. You can put the advertisement with a discontinuity. Perhaps, the ad might be in a different file format.

#EXT-X-PROGRAM-DATE-TIME

This tag indicates the absolute date and time of the related segment. It is usable when you need a date/time value direct from video. Think, you are writing a mobile player and the user can change the date of the device. So you will need the absolute date for a live event.

#EXT-X-TARGETDURATION

This tag indicates the max duration of the media segments. It helps the client to calculate and manage the memory in an efficient way. How many segments should it download for caching for example.

#EXT-X-START

This tag indicates a preferred starting point for the video. You guess what it is useful for.

--

--