pub enum HardwareAccel {
Auto,
None,
Nvdec,
Qsv,
Amf,
VideoToolbox,
Vaapi,
}Expand description
Hardware acceleration configuration.
This enum specifies which hardware acceleration method to use for video decoding. Hardware acceleration can significantly improve decoding performance, especially for high-resolution content.
§Platform Support
| Mode | Platform | GPU Required |
|---|---|---|
Nvdec | Windows/Linux | NVIDIA |
Qsv | Windows/Linux | Intel |
Amf | Windows/Linux | AMD |
VideoToolbox | macOS/iOS | Any |
Vaapi | Linux | Various |
§Fallback Behavior
When Auto is used, the decoder will try available
accelerators in order of preference and fall back to software
decoding if none are available.
Variants§
Auto
Automatically detect and use available hardware.
The decoder will probe for available hardware accelerators and use the best one available. Falls back to software decoding if no hardware acceleration is available.
None
Disable hardware acceleration (CPU only).
Forces software decoding using the CPU. This may be useful for debugging, consistency, or when hardware acceleration causes issues.
Nvdec
NVIDIA NVDEC.
Uses NVIDIA’s dedicated video decoding hardware. Supports most common codecs including H.264, H.265, VP9, and AV1 (on newer GPUs). Requires an NVIDIA GPU with NVDEC support.
Qsv
Intel Quick Sync Video.
Uses Intel’s integrated GPU video engine. Available on most Intel CPUs with integrated graphics. Supports H.264, H.265, VP9, and AV1 (on newer platforms).
Amf
AMD Advanced Media Framework.
Uses AMD’s dedicated video decoding hardware. Available on AMD GPUs and APUs. Supports H.264, H.265, and VP9.
VideoToolbox
Apple VideoToolbox.
Uses Apple’s hardware video decoding on macOS and iOS. Works with
both Intel and Apple Silicon Macs. Supports H.264, H.265, and ProRes.
Vaapi
Video Acceleration API (Linux).
A Linux-specific API that provides hardware-accelerated video decoding across different GPU vendors. Widely supported on Intel, AMD, and NVIDIA GPUs on Linux.
Implementations§
Source§impl HardwareAccel
impl HardwareAccel
Sourcepub const fn is_specific(&self) -> bool
pub const fn is_specific(&self) -> bool
Returns true if this represents an enabled hardware accelerator.
Returns false for None and Auto.
§Examples
use ff_decode::HardwareAccel;
assert!(!HardwareAccel::Auto.is_specific());
assert!(!HardwareAccel::None.is_specific());
assert!(HardwareAccel::Nvdec.is_specific());
assert!(HardwareAccel::Qsv.is_specific());Trait Implementations§
Source§impl Clone for HardwareAccel
impl Clone for HardwareAccel
Source§fn clone(&self) -> HardwareAccel
fn clone(&self) -> HardwareAccel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more