pub struct PassStatistics {
pub frames: Vec<FrameStatistics>,
pub total_frames: u64,
pub total_bits: u64,
pub avg_qp: f64,
pub avg_frame_bits: f64,
pub width: u32,
pub height: u32,
pub framerate_num: u32,
pub framerate_den: u32,
}Expand description
First-pass statistics collection.
Fields§
§frames: Vec<FrameStatistics>All frame statistics.
total_frames: u64Total frames encoded.
total_bits: u64Total bits used.
avg_qp: f64Average QP across all frames.
avg_frame_bits: f64Average frame size in bits.
width: u32Video width.
height: u32Video height.
framerate_num: u32Frame rate numerator.
framerate_den: u32Frame rate denominator.
Implementations§
Source§impl PassStatistics
impl PassStatistics
Sourcepub fn new(
width: u32,
height: u32,
framerate_num: u32,
framerate_den: u32,
) -> Self
pub fn new( width: u32, height: u32, framerate_num: u32, framerate_den: u32, ) -> Self
Create a new pass statistics collector.
Sourcepub fn add_frame(&mut self, stats: FrameStatistics)
pub fn add_frame(&mut self, stats: FrameStatistics)
Add a frame’s statistics.
Sourcepub fn get_frame(&self, index: u64) -> Option<&FrameStatistics>
pub fn get_frame(&self, index: u64) -> Option<&FrameStatistics>
Get statistics for a specific frame.
Sourcepub fn average_bitrate(&self) -> u64
pub fn average_bitrate(&self) -> u64
Get average bitrate in bits per second.
Sourcepub fn peak_bitrate(&self) -> u64
pub fn peak_bitrate(&self) -> u64
Get peak bitrate (highest frame size * framerate).
Sourcepub fn complexity_distribution(&self) -> ComplexityStats
pub fn complexity_distribution(&self) -> ComplexityStats
Calculate complexity distribution across frames.
Sourcepub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load statistics from a file.
Trait Implementations§
Source§impl Clone for PassStatistics
impl Clone for PassStatistics
Source§fn clone(&self) -> PassStatistics
fn clone(&self) -> PassStatistics
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 PassStatistics
impl RefUnwindSafe for PassStatistics
impl Send for PassStatistics
impl Sync for PassStatistics
impl Unpin for PassStatistics
impl UnsafeUnpin for PassStatistics
impl UnwindSafe for PassStatistics
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