Skip to the content.

1️⃣ What is HLS?

HLS (HTTP Live Streaming) is a streaming protocol developed by Apple for delivering video and audio over the internet.

Goal: Provide smooth, continuous playback even when the network fluctuates.


2️⃣ How HLS Works

HLS works in 3 main steps:

Step 1: Video Preparation (Encoding & Segmentation)

Step 2: Playlist Creation (M3U8)

Example Master Playlist (master.m3u8):

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=500000,RESOLUTION=640x360
low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1500000,RESOLUTION=1280x720
mid.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3000000,RESOLUTION=1920x1080
high.m3u8

Example Media Playlist (mid.m3u8):

#EXTM3U
#EXTINF:10,
seg1.ts
#EXTINF:10,
seg2.ts
#EXTINF:10,
seg3.ts

Step 3: Streaming to Client


3️⃣ Key Features of HLS

Feature Description
Adaptive Bitrate Smooth playback under fluctuating network
HTTP-based Works with standard web servers and CDNs
Chunked streaming Segments allow quick startup and buffering
Live streaming support Can stream live events efficiently
Wide device support iOS, Android, Web, Smart TVs

4️⃣ Comparison with DASH

Feature HLS DASH
Developer Apple MPEG / Open standard
Playlist format M3U8 MPD (XML)
Segment format TS (transport stream) MP4 fragments
Latency Higher (~6–10s) Lower (~2–4s with low-latency DASH)
Device support Excellent on Apple devices Broader on Android, Web, Cross-platform

5️⃣ Use Cases


6️⃣ Quick Analogy

Think of HLS like a playlist of small video clips: