transmux 0.22.0

Any-to-any media container muxing hub: demux TS, fMP4/CMAF, MPEG-PS, WebM, FLV, or RTMP into one neutral IR and mux to CMAF/fMP4, progressive MP4, TS, DASH, low-latency DASH, HLS, low-latency HLS, Smooth Streaming, or RTMP. CENC/CBCS encrypt+decrypt, SSAI splice, RTP/RTCP, and an fMP4/CMAF conformance validator; parses codec config headers only, samples stay opaque. no_std + alloc.
Documentation
//! The transmux media intermediate representation (IR).
//!
//! This is the neutral hub form every demuxer produces and every muxer
//! consumes (the transmux side of the `broadcast-common` container-mux
//! vocabulary, [`broadcast_common::Unpackage`] / [`broadcast_common::Package`]):
//!
//! - [`Media`] — a set of elementary [`Track`]s, plus the movie timescale and
//!   an optional recovered PCR timeline ([`PcrSample`]).
//! - [`Track`] — one elementary track: its identity/codec config
//!   ([`TrackSpec`] wrapping [`CodecConfig`]) plus its decode-ordered
//!   [`Sample`]s, an absolute decode-time anchor, and optional CENC/CBCS
//!   crypto metadata ([`TrackEncryption`]).
//! - [`Sample`] — one coded access unit: data bytes, absolute optional
//!   `dts`/`pts` (media plane step 2c), optional duration, [`SampleFlags`],
//!   and optional debug-only [`Provenance`].
//! - [`CodecConfig`] — per-track codec configuration (decoder config record +
//!   geometry, or the opaque [`CodecConfig::Data`] carriage for PMT-listed
//!   streams this crate does not decode — see [`DataCarriage`]).
//! - [`FragmentTrackData`] — one track's samples for a single media segment,
//!   the input shape [`crate::pipeline::build_media_segment`] consumes.
//! - [`DemuxEvent`] — the streaming-demux event vocabulary (media plane step
//!   2e), drained from [`crate::ts_demux::StreamingTsDemux`] /
//!   [`crate::flv_stream::StreamingFlvDemux`]; [`EventProvenance`] carries the
//!   container-native identity (e.g. a TS PID) a neutral event needs to omit
//!   from its primary fields.
//!
//! # Invariants
//!
//! - [`Sample::dts`]/[`Sample::pts`] are stored *absolutely*, in the track's
//!   media timescale (media plane step 2c) — `None` only for section-carried
//!   tracks (SCTE-35/DSM-CC/private sections), which have no timestamp at
//!   all, never fabricated. [`Track::start_decode_time`] is kept in lockstep
//!   as the track's anchor (equal to its first sample's `dts` when the track
//!   is timed) — the DTS the track's first sample sits at on the
//!   presentation timeline (maps onto the fragment `tfdt`
//!   `baseMediaDecodeTime`, ISO/IEC 14496-12:2015 §8.8.12).
//! - 33-bit (TS) / 32-bit (RTP) rollover is unwrapped once, at the demux edge
//!   (`crate::ts_demux`, `crate::rtp`) — never re-derived downstream.
//! - Samples within a [`Track`] are always in decode order.
//! - [`Track::encryption`], when present, must have exactly one
//!   [`crate::cenc::SampleEncryptionEntry`] per [`Track::samples`] entry.
//!
//! This module is a pure type consolidation (media plane step 2a): the
//! packagers/depackagers built on this IR ([`Fmp4Demux`](crate::media::Fmp4Demux),
//! [`CmafMux`](crate::media::CmafMux), [`HlsPackager`](crate::media::HlsPackager))
//! and the segment-authoring machinery ([`crate::pipeline::build_init_segment`] /
//! [`crate::pipeline::build_media_segment`]) stay in their existing modules —
//! only the data types moved.

mod codec;
mod event;
mod media;
mod sample;
mod track;

pub use codec::{CodecConfig, DataCarriage, SubtitleFormat};
pub use event::{AbandonReason, DemuxEvent, DiscontinuityKind, EventProvenance, InputDegradation};
pub use media::{Media, PcrSample, SkippedTrack};
pub use sample::{FragmentTrackData, Provenance, Sample, SampleFlags};
pub use track::{Track, TrackEncryption, TrackSpec};