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

Masato Takabe
Masato Takabe

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:

  1. Extract elementary streams (H.264, AAC, etc.) from the TS container
  2. Recalculate PTS (Presentation Time Stamp) and DTS (Decoding Time Stamp) into continuous values
  3. 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:

  1. Read header information from the initialization segment
  2. Concatenate the moof/mdat boxes from each media segment
  3. No container conversion needed — processing is fast

Decrypting Encrypted Segments

HLS supports segment encryption for content protection.

Decryption process:

  1. Extract the encryption key URI from the m3u8 playlist
  2. Download the encryption key from the key server
  3. Retrieve the IV (Initialization Vector) parameter
  4. 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.

HLSDASH
Developed byAppleMPEG (international standard)
Playlist format.m3u8.mpd (XML)
Segment formatTS, fMP4MP4
Browser supportNative in Safari; library required elsewhereLibrary required
Used byYouTube, 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.

Masato Takabe
Masato TakabeTechnical Advisor

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.