pub enum RateControlMode {
Crf(u8),
Cbr(u64),
Vbr {
target: u64,
max: u64,
},
ConstrainedVbr {
target: u64,
max: u64,
buffer_size: u64,
},
Abr(u64),
}Expand description
Rate control modes for video encoding.
Variants§
Crf(u8)
Constant Rate Factor (quality-based).
Maintains consistent quality across the video. Lower values = higher quality, larger file. Typical range: 18-28 (23 is default for many codecs).
Cbr(u64)
Constant Bitrate (CBR).
Maintains a constant bitrate throughout. Good for streaming with bandwidth constraints. Value in bits per second.
Vbr
Variable Bitrate (VBR).
Allows bitrate to vary based on complexity. Target bitrate in bits per second, with quality factor.
ConstrainedVbr
Constrained Variable Bitrate.
VBR with strict maximum bitrate limits.
Fields
Abr(u64)
Average Bitrate (ABR).
Targets an average bitrate over the entire video.
Implementations§
Source§impl RateControlMode
impl RateControlMode
Sourcepub fn target_bitrate(&self) -> Option<u64>
pub fn target_bitrate(&self) -> Option<u64>
Gets the target bitrate for this rate control mode.
Sourcepub fn max_bitrate(&self) -> Option<u64>
pub fn max_bitrate(&self) -> Option<u64>
Gets the maximum bitrate for this rate control mode.
Sourcepub fn is_constant_quality(&self) -> bool
pub fn is_constant_quality(&self) -> bool
Checks if this is a constant quality mode.
Sourcepub fn is_bitrate_mode(&self) -> bool
pub fn is_bitrate_mode(&self) -> bool
Checks if this is a bitrate-based mode.
Trait Implementations§
Source§impl Clone for RateControlMode
impl Clone for RateControlMode
Source§fn clone(&self) -> RateControlMode
fn clone(&self) -> RateControlMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RateControlMode
impl Debug for RateControlMode
Source§impl<'de> Deserialize<'de> for RateControlMode
impl<'de> Deserialize<'de> for RateControlMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RateControlMode
impl PartialEq for RateControlMode
Source§impl Serialize for RateControlMode
impl Serialize for RateControlMode
impl Copy for RateControlMode
impl Eq for RateControlMode
impl StructuralPartialEq for RateControlMode
Auto Trait Implementations§
impl Freeze for RateControlMode
impl RefUnwindSafe for RateControlMode
impl Send for RateControlMode
impl Sync for RateControlMode
impl Unpin for RateControlMode
impl UnsafeUnpin for RateControlMode
impl UnwindSafe for RateControlMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more