pub enum VideoCodec {
H264,
OpenH264,
H265,
Kvazaar,
Vp8,
Vp9,
Av1,
Svtav1,
}Expand description
Which software encoder to open. Whatever’s picked, SwEncoder::new
fails with SwEncoderError::CodecNotFound (not a panic) if the
linked ffmpeg build doesn’t actually have it — this crate never
vendors any of these, it’s whatever the local ffmpeg install was built
with (check with ffmpeg -encoders).
GPL-licensed encoders need an ffmpeg build compiled with
--enable-gpl (separate from — and unlike — FFmpeg’s own native
h264/hevc decoders, which SwDecoder already uses and which
carry no such requirement; GPL only enters the picture on the encode
side, through these specific libraries): VideoCodec::H264 and
VideoCodec::H265 are GPL. Every other variant here is a
permissively-licensed (BSD/similar) alternative that needs no special
build flag beyond being enabled at all.
libx264 — H.264. GPL.
Variants§
H264
OpenH264
libopenh264 — H.264, Cisco’s BSD-2-Clause encoder (Cisco covers
H.264 patent royalties for binary redistributions of it). The
non-GPL alternative to VideoCodec::H264.
H265
libx265 — H.265/HEVC. GPL.
Kvazaar
libkvazaar — H.265/HEVC, BSD-2-Clause. The non-GPL alternative
to VideoCodec::H265.
Vp8
libvpx — VP8, BSD-3-Clause.
Vp9
libvpx-vp9 — VP9, BSD-3-Clause (same libvpx project as
VideoCodec::Vp8, different encoder name).
Av1
libaom-av1 — AV1’s reference encoder, BSD-2-Clause. Most
broadly compatible AV1 output, but much slower than
VideoCodec::Svtav1 — prefer that one unless you specifically
need libaom’s own encoding behavior.
Svtav1
libsvtav1 — AV1 via Intel’s SVT-AV1, BSD-2-Clause-Patent. Far
faster than VideoCodec::Av1 (libaom-av1) at a given quality
target — the practical default for real-time AV1 encoding.
Trait Implementations§
Source§impl Clone for VideoCodec
impl Clone for VideoCodec
Source§fn clone(&self) -> VideoCodec
fn clone(&self) -> VideoCodec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more