pub struct TargetSizeSolver {
pub target_bytes: u64,
pub duration_frames: u32,
pub fps: f32,
}Expand description
Solves for the average bitrate (kbps) that achieves a target file size using binary search over the fill-factor-adjusted bitrate formula.
Fields§
§target_bytes: u64Target output size in bytes.
duration_frames: u32Number of frames in the segment.
fps: f32Frame rate.
Implementations§
Source§impl TargetSizeSolver
impl TargetSizeSolver
Sourcepub fn solve_bitrate(&self, complexity_factor: f32) -> u32
pub fn solve_bitrate(&self, complexity_factor: f32) -> u32
Performs a binary search to find the bitrate (kbps) that fills
target_bytes at the given complexity_factor [0.5, 2.0].
The complexity factor scales the effective fill factor (higher complexity → content is harder to compress → more bits needed per unit of quality), meaning the solver converges to a slightly higher bitrate for complex content.
Trait Implementations§
Source§impl Clone for TargetSizeSolver
impl Clone for TargetSizeSolver
Source§fn clone(&self) -> TargetSizeSolver
fn clone(&self) -> TargetSizeSolver
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 moreAuto Trait Implementations§
impl Freeze for TargetSizeSolver
impl RefUnwindSafe for TargetSizeSolver
impl Send for TargetSizeSolver
impl Sync for TargetSizeSolver
impl Unpin for TargetSizeSolver
impl UnsafeUnpin for TargetSizeSolver
impl UnwindSafe for TargetSizeSolver
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