pub struct TwoPassStatistics {Show 14 fields
pub frame_count: usize,
pub mean_complexity: f64,
pub peak_complexity: f64,
pub min_complexity: f64,
pub complexity_std_dev: f64,
pub complex_region_fraction: f64,
pub total_bit_budget: u64,
pub avg_bits_per_frame: u64,
pub max_bits_per_frame: u64,
pub min_bits_per_frame: u64,
pub target_bitrate_kbps: u32,
pub duration_ms: u64,
pub complexity_histogram: [u32; 10],
pub scene_change_indices: Vec<usize>,
}Expand description
Comprehensive statistics collected from the two-pass encoding process.
This provides detailed information about the content complexity, bit allocation, and quality metrics gathered during the first pass that guides the second pass encoding.
Fields§
§frame_count: usizeTotal number of frames analyzed.
mean_complexity: f64Mean complexity score across all frames (0.0-1.0).
peak_complexity: f64Peak (maximum) complexity observed.
min_complexity: f64Minimum complexity observed.
complexity_std_dev: f64Standard deviation of complexity scores.
complex_region_fraction: f64Fraction of frames classified as complex regions (0.0-1.0).
total_bit_budget: u64Total bit budget in bits.
avg_bits_per_frame: u64Average bits per frame.
max_bits_per_frame: u64Maximum bits allocated to any single frame.
min_bits_per_frame: u64Minimum bits allocated to any single frame.
target_bitrate_kbps: u32Target bitrate in kbps.
duration_ms: u64Content duration in milliseconds.
complexity_histogram: [u32; 10]Complexity histogram (10 bins covering 0.0-1.0).
scene_change_indices: Vec<usize>Scene change indices (frames where complexity jumps significantly).
Implementations§
Source§impl TwoPassStatistics
impl TwoPassStatistics
Sourcepub fn content_uniformity(&self) -> f64
pub fn content_uniformity(&self) -> f64
Returns the compression ratio (mean complexity / peak complexity).
Values close to 1.0 indicate uniform content; values close to 0.0 indicate highly variable content that benefits most from two-pass.
Sourcepub fn bit_allocation_ratio(&self) -> f64
pub fn bit_allocation_ratio(&self) -> f64
Returns the bit allocation ratio (max bits / avg bits).
Higher values indicate more aggressive bit redistribution.
Sourcepub fn benefits_from_two_pass(&self) -> bool
pub fn benefits_from_two_pass(&self) -> bool
Returns true if the content would significantly benefit from
two-pass encoding (high complexity variance).
Sourcepub fn scene_change_count(&self) -> usize
pub fn scene_change_count(&self) -> usize
Returns the number of detected scene changes.
Trait Implementations§
Source§impl Clone for TwoPassStatistics
impl Clone for TwoPassStatistics
Source§fn clone(&self) -> TwoPassStatistics
fn clone(&self) -> TwoPassStatistics
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 TwoPassStatistics
impl RefUnwindSafe for TwoPassStatistics
impl Send for TwoPassStatistics
impl Sync for TwoPassStatistics
impl Unpin for TwoPassStatistics
impl UnsafeUnpin for TwoPassStatistics
impl UnwindSafe for TwoPassStatistics
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> 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>
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