pub struct BitrateTarget {
pub mode: RcMode,
pub target_kbps: u32,
pub min_kbps: u32,
pub max_kbps: u32,
pub quality_param: f32,
}Expand description
Describes the desired bitrate (or quality) target for an encoder.
Fields§
§mode: RcModeRate-control mode.
target_kbps: u32Target bitrate in kbps (for CBR/VBR modes).
min_kbps: u32Minimum bitrate in kbps (VBR lower bound; 0 = no limit).
max_kbps: u32Maximum bitrate in kbps (VBR upper bound; 0 = no limit).
quality_param: f32Quality parameter: CRF value or QP index (ignored for CBR/VBR).
Implementations§
Source§impl BitrateTarget
impl BitrateTarget
Sourcepub fn vbr(target_kbps: u32, min_kbps: u32, max_kbps: u32) -> Self
pub fn vbr(target_kbps: u32, min_kbps: u32, max_kbps: u32) -> Self
Create a VBR target with min/max bounds.
Sourcepub fn crf(crf: f32) -> Self
pub fn crf(crf: f32) -> Self
Create a CRF target with a given CRF value (lower = higher quality).
Sourcepub fn effective_kbps(&self) -> u32
pub fn effective_kbps(&self) -> u32
Returns the effective bitrate in kbps.
For quality-based modes, returns 0 (no hard bitrate target).
Sourcepub fn has_bitrate_budget(&self) -> bool
pub fn has_bitrate_budget(&self) -> bool
Returns true when a hard bitrate budget is set.
Trait Implementations§
Source§impl Clone for BitrateTarget
impl Clone for BitrateTarget
Source§fn clone(&self) -> BitrateTarget
fn clone(&self) -> BitrateTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BitrateTarget
impl Debug for BitrateTarget
Source§impl PartialEq for BitrateTarget
impl PartialEq for BitrateTarget
impl Copy for BitrateTarget
impl StructuralPartialEq for BitrateTarget
Auto Trait Implementations§
impl Freeze for BitrateTarget
impl RefUnwindSafe for BitrateTarget
impl Send for BitrateTarget
impl Sync for BitrateTarget
impl Unpin for BitrateTarget
impl UnsafeUnpin for BitrateTarget
impl UnwindSafe for BitrateTarget
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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