transmux 0.4.1

MPEG-2 TS → CMAF/fMP4 remux: typed ISOBMFF boxes, a samples-in init/media segment builder, Annex B ↔ length-prefixed NAL, and HLS playlist generation (ISO/IEC 14496-12, RFC 8216).
Documentation
//! `transmux` — MPEG-2 TS → CMAF/fMP4 container remux (ISO/IEC 14496-12:2015).
//!
//! A **samples-in** container multiplexer: the caller supplies demuxed *coded*
//! access units + codec config, and `transmux` produces CMAF initialization and
//! media segments plus HLS playlists. It parses codec config/parameter headers
//! (SPS/PPS/VPS, AAC ASC, AC-3/E-AC-3 syncframe BSI) only to build the container
//! boxes and derive metadata — it never encodes or decodes media; coded samples
//! pass through opaque. `no_std` + `alloc`.
//!
//! See the crate README for the full **feature matrix** (implemented boxes and
//! codecs plus planned coverage). Key entry points: [`build_init_segment`] and
//! [`build_media_segment`] (batch), [`Segmenter`] (streaming), [`AvcSps::decode`]
//! with [`AvcSps::rfc6381`] (codec metadata), and the HLS playlist builders.
//!
//! This crate root also exposes the low-level ISOBMFF framing it is built on:
//! [`BoxHeader`] (optional 64-bit `largesize` / `uuid` extended type),
//! [`FullBoxHeader`] (`version` + `flags`), and a size-driven box walker
//! ([`BoxIter`]) that skips unknown box types by advancing by `size`.
//!
//! # Quick start
//!
//! ```rust
//! use transmux::{box_iter, parse_box, BoxHeader, BoxType};
//! use broadcast_common::Parse;
//!
//! // Parse a simple ftyp box header.
//! let bytes = [0, 0, 0, 12, b'f', b't', b'y', b'p', 0, 0, 0, 0];
//! let header = BoxHeader::parse(&bytes).unwrap();
//! assert_eq!(header.box_type.to_string(), "ftyp");
//! ```
//!
//! # Spec citations
//!
//! - **Box / FullBox**: ISO/IEC 14496-12:2015 §4.2 (fulltext L1254–L1304).
//! - **Box order**: §6.2.3 (recommendations; only `ftyp` before variable-length and
//!   `moof` sequence_number are mandatory).
//! - **Skip-unknown rule**: §4.2 L1294 — unknown type → ignore + skip via size.
//!
//! # Feature flags
//!
//! | Feature | Default | Description |
//! |---------|---------|-------------|
//! | `std`   | yes     | `std::error::Error` impls |
//! | `serde` | yes     | `serde::Serialize` for box types |

#![cfg_attr(not(feature = "std"), no_std)]
#![forbid(unsafe_code)]
extern crate alloc;

pub mod aac_asc;
pub mod ac3;
pub mod annexb;
pub mod avc_config;
pub mod bitreader;
pub mod box_types;
pub mod error;
pub mod hevc_config;
pub mod hls;
pub mod init_segment;
pub mod movie_fragment;
pub mod mp4esds;
pub mod nalu_types;
pub mod pipeline;
pub mod sample_entries;
pub mod segmenter;
pub mod segments;
pub mod sps;
pub mod timing;

pub use aac_asc::{
    build_adts_header, parse_adts_header, AdtsHeader, AudioObjectType, AudioSpecificConfig,
    ChannelConfiguration, SamplingFrequencyIndex,
};
pub use ac3::{Ac3SpecificBox, Ac3SyncframeInfo, Ec3SpecificBox, Ec3Substream, Ec3SyncframeInfo};
pub use annexb::{
    annexb_to_length_prefixed, iter_annexb_nals, iter_length_prefixed_nals,
    length_prefixed_to_annexb, NAL_LENGTH_SIZE,
};
pub use avc_config::{AVCConfigurationBox, AVCDecoderConfigurationRecord};
pub use box_types::{box_iter, parse_box, BoxHeader, BoxIter, BoxRef, BoxType, FullBoxHeader};
pub use error::{Error, Result};
pub use hevc_config::{HEVCConfigurationBox, HEVCDecoderConfigurationRecord};
pub use hls::{MasterPlaylist, MediaPlaylist, MediaSegment, Variant};
pub use init_segment::{
    Ac3SampleEntry, ChunkOffsetBox, DataEntryUrlBox, DataInformationBox, DataReferenceBox,
    Ec3SampleEntry, EditBox, HandlerBox, MediaBox, MediaHeaderBox, MediaInformationBox, MovieBox,
    MovieExtendsBox, MovieHeaderBox, Mp4aSampleEntry, OpaqueBox, SampleDescriptionBox,
    SampleEntryVariant, SampleSizeBox, SampleTableBox, SampleToChunkBox, SoundMediaHeaderBox,
    StblChild, StscEntry, TrackBox, TrackExtendsBox, TrackHeaderBox, VideoMediaHeaderBox,
};
pub use movie_fragment::{
    MovieFragmentBox, MovieFragmentHeaderBox, TrackFragmentBaseMediaDecodeTimeBox,
    TrackFragmentBox, TrackFragmentHeaderBox, TrackFragmentRunBox, TrunSample,
};
pub use mp4esds::{
    DecoderConfigDescriptor, DecoderSpecificInfo, ESDescriptor, EsdsBox, ObjectTypeIndication,
    SLConfigDescriptor, StreamType,
};
pub use nalu_types::{AvcPps, AvcSps, AvcSpsExt, HevcNalArray, HevcNalUnit};
pub use pipeline::{
    build_init_segment, build_media_segment, CodecConfig, FragmentTrackData, Sample, TrackSpec,
};
pub use sample_entries::{AVCSampleEntry, HEVCSampleEntry};
pub use segmenter::Segmenter;
pub use segments::{FileTypeBox, MediaDataBox, SegmentTypeBox};
pub use sps::{
    decode_avc_sps, decode_hevc_sps, rfc6381_avc1, rfc6381_hvc1, rfc6381_mp4a, AvcSpsInfo,
    HevcSpsInfo,
};
pub use timing::{
    CompositionOffsetBox, CompositionToDecodeBox, CttsEntry, EditListBox, EditListEntry,
    SegmentIndexBox, SidxReference, SttsEntry, TimeToSampleBox,
};