pub enum SimpleRateControlMode {
ConstantQuality {
crf: u8,
},
AverageBitrate {
target_kbps: u32,
},
ConstantBitrate {
target_kbps: u32,
vbv_size_kb: u32,
},
VariableBitrate {
min_kbps: u32,
max_kbps: u32,
target_kbps: u32,
},
TwoPass {
target_kbps: u32,
first_pass_stats: Option<String>,
},
}Expand description
Simplified rate control mode for video encoding.
Each variant carries all parameters needed to drive the corresponding algorithm without requiring a separate configuration struct.
Variants§
ConstantQuality
Constant-quality mode (CRF / CQ).
The crf value (0–63, lower = higher quality) drives a QP calculation.
Bitrate is not constrained; it grows with content complexity.
AverageBitrate
Average-bitrate mode (ABR).
The encoder targets target_kbps averaged over the whole clip.
Individual frames may deviate based on content complexity.
ConstantBitrate
Constant-bitrate mode (CBR) with a VBV (Video Buffer Verifier) buffer.
Per-frame bits are clamped so that the VBV never overflows (fullness > 0.9) or starves (fullness < 0.3).
Fields
VariableBitrate
Variable-bitrate mode (VBR).
Like ABR but the instantaneous bitrate is clamped to [min_kbps, max_kbps].
Fields
TwoPass
Two-pass average-bitrate mode.
On the second pass, bits are allocated proportional to the per-frame
complexity ratios recorded during the first pass. first_pass_stats
is a newline-separated string of f32 complexity values, one per
frame (e.g. produced by SimpleRateController::record_frame).
Trait Implementations§
Source§impl Clone for SimpleRateControlMode
impl Clone for SimpleRateControlMode
Source§fn clone(&self) -> SimpleRateControlMode
fn clone(&self) -> SimpleRateControlMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SimpleRateControlMode
impl RefUnwindSafe for SimpleRateControlMode
impl Send for SimpleRateControlMode
impl Sync for SimpleRateControlMode
impl Unpin for SimpleRateControlMode
impl UnsafeUnpin for SimpleRateControlMode
impl UnwindSafe for SimpleRateControlMode
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