Hakari

What is HLS?

HLS (HTTP Live Streaming) is Apple's standard for delivering live and on-demand video over HTTP. A client fetches a playlist, follows it to a list of short video segments, and plays them in order. Every major browser, TV, set-top box, mobile OS, and player supports HLS.

It's the most widely-deployed streaming format on earth. If you only want to support one format, HLS is it.

How it works

Two layers:

  1. Master playlist (.m3u8) — lists the available variants (different resolutions, bitrates). Viewers pick the best one their connection supports.
  2. Media playlist — per variant. Lists short segment files in order, tagged with duration.

Clients poll the media playlist every few seconds to discover new segments.

Master playlist

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-STREAM-INF:BANDWIDTH=3000000,RESOLUTION=1280x720,CODECS="avc1.42c01f,mp4a.40.2"
720p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1500000,RESOLUTION=854x480,CODECS="avc1.42c01f,mp4a.40.2"
480p.m3u8

Media playlist

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:245
#EXT-X-MAP:URI="init.m4s"
#EXTINF:5.98,
seg_245.m4s
#EXTINF:6.02,
seg_246.m4s
#EXTINF:6.00,
seg_247.m4s

Segment formats

HLS segments can be:

  • MPEG-TS (.ts) — the original format. Chunky (188-byte packets padded out), works everywhere.
  • fMP4 (.m4s) — fragmented MP4. Smaller overhead, shared codec ecosystem with DASH. Supported by all modern clients.

Hakari uses fMP4 for both live LLHLS and VOD output — it's smaller and more efficient.

Adaptive bitrate

The master playlist lists multiple renditions (e.g. 1080p / 720p / 480p). The player picks the highest variant that fits the measured bandwidth and switches mid-stream as conditions change. The user sees "quality" shift silently; you pay with slightly more storage and transcode cost for each rung.

HLS latency

Classic HLS: ~15–30 seconds end-to-end. The player needs 3 full segments buffered before it starts playing, and segments are typically 6 seconds. That's terrible for interactive use.

Two ways to fix that:

  1. Shorter segments — drop segment duration to 2s. Helps, but at the cost of more HTTP requests and worse compression efficiency.
  2. LLHLS (Low-Latency HLS) — Apple's official low-latency extension. Sub-segment "parts" arrive as they're encoded, with blocking playlist reloads so clients don't miss anything. 2–4 second glass-to-glass.

If latency matters, use LLHLS. If you need maximum compatibility with dated clients, plain HLS is the safer pick.

HLS vs DASH

| | HLS | DASH | | --- | --- | --- | | Manifest | .m3u8 (text) | .mpd (XML) | | Origin | Apple | MPEG/ISO | | Native Safari/iOS | Yes | No | | Native Android (via ExoPlayer) | Yes | Yes | | Codec flexibility | Good | Slightly better | | In practice | Use this first | Use if you need MPD for existing tooling |

Both use fMP4 segments. The difference is overwhelmingly about the manifest format and which devices support it natively. HLS + fMP4 covers basically everything; DASH is worth it mainly if your existing toolchain is DASH-native.

HLS on Hakari

Live

Enable hls in your stream's playback protocols. The URL shape:

https://stream.hakari.cloud/app/<streamKey>/ts:hls.m3u8

The ts: prefix tells the edge this is the legacy MPEG-TS HLS path, served unbuffered from the live origin. For most use cases LLHLS is a better default; reach for HLS when you need legacy Safari support or you're piping into a downstream CDN that only speaks classic HLS.

VOD

Every transcoded VOD defaults to HLS output (outputFormat: "hls"). The master playlist is at:

https://stream.hakari.cloud/vod/<vodId>/master.m3u8

Choose dash at upload time if you prefer MPD.

  • LLHLS — Apple's low-latency HLS, use this if latency matters.
  • DASH — the ISO standard alternative.
  • CMAF / fMP4 — the container format HLS and DASH share.
  • DVR — scrub backwards in a live HLS stream.