Skip to main content

Module codec

Module codec 

Source
Available on crate feature codec only.
Expand description

Codec bitstream helpers — turning wire bytes into engine metadata and MediaFrame classification.

Gated behind the per-codec features (codec-h264, codec-h265, codec-av1, codec-vp9, codec-vvc, codec-aac; codec = H.264 + AAC; codecs-all = everything). Every parser is pure Rust with no native dependencies.

All codecs share the CodecParser contract: extract VideoParams from a config header, and classify random-access points so the kernel’s GOP cache, segmenter, eviction, and recorder — which key only on MediaFrame::is_keyframe — work unchanged.

use arcly_stream::codec::dispatch;
use arcly_stream::CodecId;

let access_unit: &[u8] = &[/* … Annex-B HEVC bytes … */];
// Codec-erased dispatch by CodecId (used at the ingest boundary):
let is_rap = dispatch::is_random_access_point(CodecId::H265, access_unit);

Re-exports§

pub use parser::CodecConfig;
pub use parser::CodecParser;
pub use parser::VideoParams;
pub use aac::parse_adts;codec-aac
pub use aac::AdtsHeader;codec-aac
pub use h264::annexb_to_avcc;codec-h264
pub use h264::avcc_to_annexb;codec-h264
pub use h264::iter_nals_annexb;codec-h264
pub use h264::parse_sps;codec-h264
pub use h264::SpsInfo;codec-h264

Modules§

aaccodec-aac
AAC helpers: ADTS frame-header parsing.
av1codec-av1
AV1 bitstream helpers: OBU sequence-header resolution extraction and random-access detection.
dispatch
Codec-erased dispatch over CodecId.
h264codec-h264
H.264 (AVC) bitstream helpers: NAL iteration, Annex-B ↔ AVCC conversion, and SPS resolution extraction.
h265codec-h265
H.265 (HEVC) bitstream helpers: NAL classification and SPS resolution extraction. Shares the Annex-B scanner and conformance-crop math with H.264.
nal_nal
Shared Annex-B NAL utilities for the NAL-based codecs (H.264, H.265, VVC).
parser
Codec-agnostic parsing contracts shared by every codec module.
vp9codec-vp9
VP9 bitstream helpers: uncompressed frame-header resolution extraction and keyframe detection.
vvccodec-vvc
VVC (H.266) bitstream helpers: NAL classification and SPS resolution extraction. Shares the Annex-B scanner and conformance-crop math with the other NAL codecs.