pub struct BitrateModel;Expand description
Bitrate model for predicting bitrate from CRF and content complexity.
Implementations§
Source§impl BitrateModel
impl BitrateModel
Sourcepub fn predict(crf: u8, complexity: f32, codec: &str) -> u32
pub fn predict(crf: u8, complexity: f32, codec: &str) -> u32
Predicts bitrate in kbps for a given CRF, content complexity, and codec.
Model: bitrate = complexity * base * 2^((crf - 28) / 6)
Codec-specific base bitrates (kbps):
- h264: 2000
- vp9: 1500 (typically more efficient)
- av1: 1200 (most efficient)
- hevc / h265: 1400
- others: 2000
Trait Implementations§
Source§impl Clone for BitrateModel
impl Clone for BitrateModel
Source§fn clone(&self) -> BitrateModel
fn clone(&self) -> BitrateModel
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 BitrateModel
impl Debug for BitrateModel
Source§impl Default for BitrateModel
impl Default for BitrateModel
Source§fn default() -> BitrateModel
fn default() -> BitrateModel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BitrateModel
impl RefUnwindSafe for BitrateModel
impl Send for BitrateModel
impl Sync for BitrateModel
impl Unpin for BitrateModel
impl UnsafeUnpin for BitrateModel
impl UnwindSafe for BitrateModel
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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