#[non_exhaustive]pub enum HardwareEncoder {
Auto,
None,
Nvenc,
Qsv,
Amf,
VideoToolbox,
Vaapi,
}Expand description
Hardware encoder type.
Specifies which hardware acceleration to use for encoding. Hardware encoding is generally faster and more power-efficient than software encoding, but may have slightly lower quality at the same bitrate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auto
Auto-detect available hardware encoder
None
Software encoding only (no hardware acceleration)
Nvenc
NVIDIA NVENC
Qsv
Intel Quick Sync Video
Amf
AMD Advanced Media Framework (AMF, formerly VCE)
VideoToolbox
Apple VideoToolbox
Vaapi
VA-API (Linux)
Implementations§
Source§impl HardwareEncoder
impl HardwareEncoder
Sourcepub fn available() -> &'static [Self]
pub fn available() -> &'static [Self]
Get the list of concrete hardware encoder backends available on this system.
Returns only actual hardware backends (NVENC, QSV, AMF, VideoToolbox,
VA-API). The control variants Auto and None
are intentionally excluded — they are configuration options, not hardware
backends.
The result is cached on first call for performance.
§Examples
use ff_encode::HardwareEncoder;
let backends = HardwareEncoder::available();
if backends.is_empty() {
println!("No hardware encoders detected");
} else {
for hw in backends {
println!("Available: {:?}", hw);
}
}Sourcepub fn is_available(self) -> bool
pub fn is_available(self) -> bool
Check if this hardware encoder is available.
Queries FFmpeg to determine if the hardware encoder is available on the current system. This checks for both H.264 and H.265 support.
§Examples
use ff_encode::HardwareEncoder;
if HardwareEncoder::Nvenc.is_available() {
println!("NVENC is available on this system");
}Trait Implementations§
Source§impl Clone for HardwareEncoder
impl Clone for HardwareEncoder
Source§fn clone(&self) -> HardwareEncoder
fn clone(&self) -> HardwareEncoder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more