Expand description
Codec identification from raw bitstream bytes.
Provides magic-byte and structural probing of codec bitstreams with a confidence score for each candidate codec. The probe intentionally avoids full parsing so that it remains fast and safe to call on untrusted data.
§Supported codecs
- AV1 — OBU temporal delimiter / sequence header signature
- VP9 — IVF frame header / superframe marker heuristic
- VP8 — VP8 frame header tag detection
- H.264 / AVC — AnnexB start codes + SPS NAL type byte
- H.265 / HEVC — AnnexB start codes + VPS/SPS NAL type bytes
- Theora — Ogg Theora identification header magic bytes
- Opus — Ogg Opus identification header magic bytes
- Vorbis — Ogg Vorbis identification header magic bytes
- FLAC — fLaC stream marker
- PCM — Raw PCM (always low confidence unless framed; detected by exclusion)
- PNG — PNG signature bytes
- GIF — GIF87a / GIF89a magic
- WebP — RIFF/WEBP container signature
- JPEG-XL — JXL codestream / ISOBMFF signature
- MPEG-4 AAC — ADTS sync word
Structs§
- Confidence
- Confidence of a probe match, expressed as a value in
[0, 100]. - Probe
Result - Result of probing a single codec against a byte buffer.
Enums§
- CodecId
- Identifies a codec or media format in the probe result.
Functions§
- probe_
all - Probe
dataagainst all known codecs and return all results sorted by descending confidence. - probe_
best - Probe
dataand return the single best-matching codec along with its confidence. - probe_
codec - Probe
dataagainst a specific codec and return the result.