pub enum AudioCodec {
Aac,
Opus,
}Expand description
Which software audio encoder to open.
Variants§
Aac
FFmpeg’s own native aac encoder — built in rather than an
external library, so unlike AudioCodec::Opus it needs nothing
added to the ffmpeg build (and no --enable-gpl, unlike
crate::elements::VideoCodec::H264/
crate::elements::VideoCodec::H265). The standard choice for
MP4 audio.
Opus
libopus — Opus (RFC 6716), BSD-3-Clause. A general-purpose
codec covering speech and music alike, whose very short frames are
why interactive systems standardized on it; WebRTC requires it,
and Ogg, WebM/Matroska, and MP4 all carry it.
Unlike AudioCodec::Aac this is an external library, so a
stripped ffmpeg build may not have it; that surfaces as
SwAudioEncoderError::CodecNotFound. It accepts only
48/24/16/12/8 kHz — see
SwAudioEncoderError::UnsupportedSampleRate.
Trait Implementations§
Source§impl Clone for AudioCodec
impl Clone for AudioCodec
Source§fn clone(&self) -> AudioCodec
fn clone(&self) -> AudioCodec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more