Available on crate feature
hls only.Expand description
Egress packaging: turn a live frame stream into HLS/LL-HLS segments.
Gated behind hls. Provides the Muxer and Packager contracts, a
sliding-window HlsPlaylist generator, and an HlsSegmenter that cuts
segments on keyframe boundaries and writes both media segments and the
.m3u8 playlist through any StorageBackend.
The container byte-format is pluggable via Muxer: a PassthroughMuxer
(elementary-stream concatenation) ships here; production MPEG-TS or fMP4/CMAF
muxers implement the same trait and drop in unchanged.
use arcly_stream::packager::{HlsSegmenter, Packager, PassthroughMuxer};
use arcly_stream::storage::FsStorage;
let storage = FsStorage::new("/var/hls");
let mut seg = HlsSegmenter::new(PassthroughMuxer::new("ts"), storage, "live/cam", 6, 5);
let mut sub = handle.subscribe_resilient();
while let Some(frame) = sub.recv().await {
seg.push(&frame).await?;
}
seg.finish().await?;Structs§
- Fmp4
Muxer fmp4 - Native fragmented-MP4 muxer for a single video track.
- HlsPlaylist
- A sliding-window HLS media playlist.
- HlsSegmenter
- Keyframe-boundary HLS segmenter writing through a
StorageBackend. - Mpeg
TsMuxer mpegts - Native MPEG-TS muxer: packages H.264 or H.265 video + AAC audio elementary streams into a single-program transport stream.
- Passthrough
Muxer - A trivial muxer that concatenates frame payloads (elementary stream).
- Segment
- One segment entry in a media playlist.