What is HLS?

HTTP Live Streaming (HLS) is an adaptive streaming communication protocol developed by Apple. It was first introduced in 2009 to solve video streaming problems on mobile devices. Today, HLS has become one of the most widely used video streaming protocols on the internet.

Unlike traditional RTMP streaming, HLS uses standard HTTP protocol to transmit video content, which means it can leverage existing CDN and proxy server infrastructure without requiring special streaming servers.

How HLS Works

📹 Source
🔧 Encoder
📦 TS Segments
📋 M3U8 Playlist
🌐 CDN
▶️ Player

1. Encoding and Segmentation

First, video content needs to be encoded by an encoder (such as FFmpeg) into H.264 or H.265 encoded TS (MPEG-2 Transport Stream) format. Then, the encoder splits the long video into small segments (usually 6-10 seconds each).

2. Creating Playlists

At the same time, the encoder generates an M3U8 playlist file that records the order and location of all video segments.

3. Adaptive Bitrate

HLS supports multi-bitrate streams. The server prepares multiple quality versions (480p, 720p, 1080p), each with its own M3U8 list and a Master Playlist. The player automatically selects the most suitable bitrate based on network conditions.

Advantages of HLS

📱 Mobile Support: HLS is the de facto standard for video playback on iOS and Android devices.

Technical Parameters