Skip to main content

Module hls

Module hls 

Source
Expand description

HLS (HTTP Live Streaming) playlist generation for CMAF VOD output.

Produces:

  • master.m3u8 — the top-level multivariant playlist with one #EXT-X-STREAM-INF per video rendition and one #EXT-X-MEDIA:TYPE=AUDIO rendition group entry pointing at the shared audio playlist.
  • <rendition>/playlist.m3u8 per video rendition — VOD media playlist with #EXT-X-MAP referring to the rendition’s init.mp4 and #EXTINF lines pointing at the seg-NNNNN.m4s files (relative URIs).
  • <audio_dir>/audio.m3u8 — the shared audio media playlist.

Spec: RFC 8216 (HLS) + Apple’s HLS Authoring Spec for VOD content, plus AV1-CMAF-HLS interoperability notes from hls.js’s test suite. We target HLS protocol version 7 — the minimum that supports EXT-X-MAP (fMP4 init segment) and EXT-X-INDEPENDENT-SEGMENTS.

Codec strings (the load-bearing CODECS attribute) are passed in by the caller — they MUST be parsed from the actual encoded bitstream by codec::codec_strings::av1_codec_string, not composed from a config file. A wrong string causes hls.js / Safari to silently skip the variant.

Structs§

AudioVariantSpec
Description of one audio rendition. CMAF-HLS uses a separate rendition group so video variants can switch bitrate without touching the audio track. We currently emit exactly one audio rendition (default English / undetermined-language); multi-track audio is a future task.
HlsManifestPaths
Paths produced by write_hls_package. Useful for the integration test + the wire-contract reporter that surfaces a manifest URL to lewd.net.
VideoVariantSpec
Description of one video rendition for the master playlist.

Functions§

write_hls_package
Emit a complete CMAF-HLS playlist tree under output_dir.