Back to Mediamtx

HLS

docs/4-read/05-hls.md

1.18.11.3 KB
Original Source

HLS

supported codecs
videoAV1, VP9, H265, H264
audioOpus, MPEG-4 Audio (AAC)
otherKLV (MPEG-TS-based HLS only)

HLS is a protocol that works by splitting streams into segments, and by serving these segments and a playlist with the HTTP protocol. You can use MediaMTX to generate an HLS stream, that is accessible through a web page:

http://localhost:8888/mystream

and can also be accessed without using the browsers, by software that supports the HLS protocol (for instance VLC or MediaMTX itself) by using this URL:

http://localhost:8888/mystream/index.m3u8

Some clients that can read with HLS are FFmpeg, GStreamer, VLC and web browsers.

HLS content can be generated in several variants:

  • MPEG-TS: uses MPEG-TS segments, for maximum compatibility.
  • fMP4: uses fragmented MP4 segments, more efficient.
  • Low-Latency: based on blocking requests that are unlocked as soon as content is available.

All HLS pameters are listed in the configuration file.

HLS can also be used to scale the server through a CDN.