Expand description
Opus configuration records and packet timing, shared by zvidlib’s containers and its Opus codec.
Opus always decodes at 48 kHz, which is therefore the sample clock of every
Opus track zvidlib reads or writes. OpusHead is the stream’s decoder
configuration in both of the forms containers carry it, and
opus_packet_samples reads a packet’s duration from its
table-of-contents byte, which is all a container needs to time a packet
without decoding it.
This is an internal crate of zvidlib,
which re-exports its public items under the paths documented there. Depend
on zvidlib rather than on this crate directly.
Structs§
- Opus
Head - The Opus identification header: the decoder configuration of an Opus stream (RFC 7845 section 5.1).
Constants§
- OPUS_
PREROLL_ SAMPLES - How much audio to decode ahead of a seek target before its samples are trusted, 320 ms.
- OPUS_
SAMPLE_ RATE - The sample rate Opus decodes at, and the sample clock of an Opus track.
Functions§
- opus_
packet_ samples - The number of 48 kHz samples one Opus packet decodes to, read from its table-of-contents byte and frame count (RFC 6716 section 3.1).
- opus_
preroll_ packets - The number of packets an
crate::AudioSampleReadershould decode ahead of a seek target in an Opus track whose packets arepackets, enough to coverOPUS_PREROLL_SAMPLESeven at the track’s shortest packet.