Adaptive live streaming plugin (HLS) for the Membrane Framework, used in production.
Membrane.HLS.Sourcereads a single media playlist (VOD or live/event) and emits raw segment payloadsMembrane.HLS.SourceBinreads a master playlist and exposes renditions as dynamic output pads- Supports multiple renditions (video, audio, subtitles)
- Handles dynamic playlist updates for live streams
- Built-in storage abstraction for different backends
-
Multiple Container Formats:
- CMAF segments (default) - Modern fragmented MP4
- MPEG-TS segments - Traditional transport stream
- Packed AAC - Audio-only streams
- AAC over TS -
⚠️ Experimental: Audio streams packed in Transport Stream containers - WebVTT - Subtitle tracks
-
Stream Types Supported:
- H.264 video encoding
- AAC audio encoding
- Text subtitles (WebVTT format)
-
Operating Modes (via
playlist_mode)::vod- segments are synced as soon as the next segment group is ready{:event, safety_delay}- live event playlists synced on a target-duration cadence{:sliding, max_segments, safety_delay}- live playlists with rolling window support
- Codec Serialization: Automatic codec string generation (avc1, hvc1, mp4a)
- Automatic Master Metadata: BANDWIDTH/AVERAGE-BANDWIDTH and CODECS are computed by SinkBin/Packager when possible
- Deprecation Notice: Manually setting
HLS.VariantStream.bandwidthandHLS.VariantStream.codecsinbuild_streamis deprecated - Segment Management: Configurable target segment durations
- Multi-track Support: Audio, video, and subtitle tracks in single pipeline
- Upstream timestamps are authoritative: SinkBin does not shift, trim, or synthesize PTS/DTS.
- Alignment required: Tracks that produce segments at a sync point must be time-aligned (minor AAC/H264 cut differences are tolerated by the packager).
- RFC-compliant output: discontinuities are inserted when needed; playlists remain spec compliant.
- Error policy:
:vodis strict and fails fast on packager errors.:event/:slidingare tolerant to recoverable timing issues but fail fast on missing mandatory track segments to avoid silent stalls.
The plugin is built on the Membrane Framework and integrates with the kim_hls library for playlist management:
Membrane.HLS.SinkBin- Main bin for processing input streams into HLS segments (acceptsmanifest_uri,playlist_mode, andHLS.Storage)Membrane.HLS.Source- Source element for a single media playlistMembrane.HLS.SourceBin- Bin wrapper that discovers renditions from a master playlist
Membrane.HLS.Sourceis demand-driven for VOD playlists and polls live/event playlists for new segments.- Segment payloads are forwarded as-is; callers provide
stream_formatto describe the container. Membrane.HLS.SourceBinhandles master playlist discovery and spins up oneMembrane.HLS.Sourceper rendition, emitting them via dynamic output pads.- Various sink implementations for different container formats
- Automatic codec detection and stream format handling
Key dependencies include:
membrane_core- Core Membrane Frameworkkim_hls- HLS playlist and segment managementmembrane_mp4_plugin- MP4/CMAF container supportmembrane_aac_plugin- AAC audio processingmembrane_h26x_plugin- H.264/H.265 video processingmembrane_mpeg_ts_plugin- MPEG-TS container support
Copyright 2025, KIM Keep In Mind GmbH Licensed under the Apache License, Version 2.0