pub struct TwoPassEncoder {
pub config: TwoPassConfig,
pub pass_one_result: Option<PassOneResult>,
}Expand description
A two-pass encoder that manages both encoding passes.
Fields§
§config: TwoPassConfigConfiguration for this encoder.
pass_one_result: Option<PassOneResult>Results from the first pass, once completed.
Implementations§
Source§impl TwoPassEncoder
impl TwoPassEncoder
Sourcepub fn new(config: TwoPassConfig) -> Self
pub fn new(config: TwoPassConfig) -> Self
Creates a new two-pass encoder from the given config.
Sourcepub fn analyze_pass_one(&mut self, complexities: Vec<f64>) -> &PassOneResult
pub fn analyze_pass_one(&mut self, complexities: Vec<f64>) -> &PassOneResult
Ingests the per-frame complexity data from pass one and stores the result.
Returns a reference to the stored PassOneResult.
Sourcepub fn encode_bitrate_for_frame(&self, frame_idx: usize) -> u32
pub fn encode_bitrate_for_frame(&self, frame_idx: usize) -> u32
Returns the recommended bitrate in kbps for the frame at frame_idx in pass two.
If pass one has not been run, falls back to the configured target bitrate.
Sourcepub fn pass_one_complete(&self) -> bool
pub fn pass_one_complete(&self) -> bool
Returns whether pass one has been completed.
Sourcepub fn statistics(&self) -> Option<TwoPassStatistics>
pub fn statistics(&self) -> Option<TwoPassStatistics>
Returns the collected statistics from pass one as a serializable report.
Auto Trait Implementations§
impl Freeze for TwoPassEncoder
impl RefUnwindSafe for TwoPassEncoder
impl Send for TwoPassEncoder
impl Sync for TwoPassEncoder
impl Unpin for TwoPassEncoder
impl UnsafeUnpin for TwoPassEncoder
impl UnwindSafe for TwoPassEncoder
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> 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