What Is HLS? A Beginner's Guide to HTTP Live Streaming

- HLS
- Video Formats
- Streaming
HLS (HTTP Live Streaming) is a video streaming technology developed by Apple.
It has been widely adopted across the video streaming industry, and is used by major platforms including YouTube and Twitch.
For a broader introduction to how video streaming works, see How Video Streaming Works — and How to Download Streaming Video.
Key Characteristics of HLS
1. HTTP-Based Delivery
HLS streams over standard web servers, so no dedicated streaming server infrastructure is required.
It also integrates well with CDNs (Content Delivery Networks), making it well suited for large-scale distribution.
2. Wide Compatibility
HLS plays on virtually every platform — iOS, Android, Windows, and macOS alike.
It has native browser support and requires no special plugins.
3. The m3u8 Playlist Format
The playlist file (.m3u8) contains:
- URLs for each video segment
- Duration of each segment
- Available quality levels (resolution and bitrate)
- Encryption information (e.g. AES-128)
HLS Segment Types
HLS video is split into multiple segments, and the processing required depends on the segment format.
TS Segments (MPEG-TS Format)
Traditional HLS uses MPEG-TS format (.ts) segments.
Characteristics:
- Widely used in the broadcast industry
- High error resilience
- File extension:
.ts
Converting to MP4:
- Extract elementary streams (H.264, AAC, etc.) from the TS container
- Recalculate PTS (Presentation Time Stamp) and DTS (Decoding Time Stamp) into continuous values
- Repackage into an MP4 container
fMP4 Segments (Fragmented MP4 Format)
More recent HLS implementations also support fMP4 format (.m4s) segments.
Characteristics:
- Already in MP4 container format
- More efficient than TS segments
- Codec information is stored in an initialization segment (
init.mp4)
Converting to MP4:
- Read header information from the initialization segment
- Concatenate the
moof/mdatboxes from each media segment - No container conversion needed — processing is fast
Decrypting Encrypted Segments
HLS supports segment encryption for content protection.
Decryption process:
- Extract the encryption key URI from the m3u8 playlist
- Download the encryption key from the key server
- Retrieve the IV (Initialization Vector) parameter
- Decrypt each segment using the specified method (e.g. AES-128)
Important:
- Decrypting DRM-protected content may be prohibited by law
- Always respect copyright and stay within legal boundaries
HLS vs. DASH
DASH (Dynamic Adaptive Streaming over HTTP) is another widely used streaming format, often compared with HLS.
| HLS | DASH | |
|---|---|---|
| Developed by | Apple | MPEG (international standard) |
| Playlist format | .m3u8 | .mpd (XML) |
| Segment format | TS, fMP4 | MP4 |
| Browser support | Native in Safari; library required elsewhere | Library required |
| Used by | YouTube, Twitch, Apple TV+ | YouTube, Netflix |
Summary
HLS is one of the most widely used technologies in modern video streaming.
Key advantages of HLS:
- Easy to deliver over standard HTTP infrastructure
- Broad platform compatibility
- Supports both TS and fMP4 segment formats
- Content protection through encryption
When downloading HLS video, keep in mind that the required processing differs depending on the segment type (TS or fMP4).
For more on downloading methods and tool selection, see How Video Streaming Works — and How to Download Streaming Video.

Joined a video streaming startup as a backend engineer after graduating. After 6 years, became a freelance engineer and technical advisor, supporting various manufacturers and startups. Focuses on streaming technologies such as HLS and DASH, and video processing optimization.