pub enum QualityPreset {
Fast,
Balanced,
Max,
}Expand description
Speed/quality trade-off, mapped to the encoder preset.
Variants§
Implementations§
Source§impl QualityPreset
impl QualityPreset
Sourcepub fn encoder_preset(self) -> &'static str
pub fn encoder_preset(self) -> &'static str
x264/x265 -preset value.
Sourcepub fn speed_flags(self, encoder: &str) -> (&'static str, &'static str)
pub fn speed_flags(self, encoder: &str) -> (&'static str, &'static str)
The speed/quality knob for a specific encoder, as (flag, value).
Encoders disagree on both the flag and its scale: x264/x265 take named
-presets, SVT-AV1 takes a numeric -preset (0 slowest … 13 fastest),
and libaom takes -cpu-used. Passing an x264 preset name to SVT-AV1 is
a hard ffmpeg error, so the argv builder must ask per encoder.
Sourcepub fn default_hw_quality(self, codec: VideoCodec) -> Option<u8>
pub fn default_hw_quality(self, codec: VideoCodec) -> Option<u8>
Default quality-mode CRF for a codec. x265 needs a higher CRF than x264
for comparable quality, and AV1 higher still, so the numbers are
codec-specific. These defaults aim for roughly VMAF ~93 (visually
near-transparent) on typical content.
VideoToolbox constant quality (-q:v, 1–100) giving about the same
VMAF as Self::default_crf with the software encoder — calibrated on
a 4K iPhone clip. Apple H.264 lands near x264’s size; Apple HEVC is ~50 %
larger than x265 at that quality. None: no hardware encoder (AV1).