Expand description
Codec profile and level definitions, and constraint validation.
This module provides:
- Profile enumerations for AV1, VP9, and Opus.
- The AV1 level table (levels 2.0 – 6.3) with decoded capability limits.
CodecConstraints— a codec-agnostic constraints bag and validation helpers for both video and audio streams.
§Example
use oximedia_codec::codec_profile::{Av1Level, CodecConstraints};
// Find the lowest AV1 level sufficient for 4K @ 60 fps / 20 Mbps.
let level = Av1Level::select_for(3840, 2160, 60.0, 20_000);
assert!(level.is_some());
// Validate a stream against AV1 Main profile constraints.
let c = CodecConstraints::av1_main();
let result = CodecConstraints::validate_video(&c, 1920, 1080, 60.0, 10_000);
assert!(result.is_ok());Structs§
- Av1Level
- An entry in the AV1 level table.
- Av1Profile
Def - Full AV1 profile definition with chroma and bit depth constraints.
- Codec
Capability - Codec capability descriptor for negotiation.
- Codec
Constraints - A codec-agnostic constraints record used for profile/level validation.
- HwDecode
Capability - Hardware decode capability for a specific decoder tier.
- Negotiated
Capability - Result of capability negotiation.
- Vp9Profile
Def - Full VP9 profile definition with bit depth and chroma constraints.
Enums§
- Av1Profile
- AV1 codec profile.
- Chroma
Subsampling - Chroma subsampling format.
- HwDecoder
Tier - Hardware decoder tier.
- Opus
Profile - Opus application / profile mode.
- Vp9Profile
- VP9 codec profile.
Functions§
- is_
profile_ compatible - Check if a decoder supporting
decoder_profilecan handle content encoded withcontent_profile. - negotiate_
capabilities - Negotiate the best common capability between an encoder and decoder.
- required_
hw_ tier - Determine the minimum hardware tier required for a given stream.