pub struct TranscodeConfig {
pub width: u32,
pub height: u32,
pub fps: f64,
pub duration_secs: f64,
pub crf: u8,
pub audio_kbps: u32,
pub target_bitrate_kbps: Option<f64>,
}Expand description
Configuration describing the input and desired output for a transcode job.
Fields§
§width: u32Input video width in pixels.
height: u32Input video height in pixels.
fps: f64Frame rate.
duration_secs: f64Duration in seconds.
crf: u8Constant Rate Factor (0 = lossless, 51 = worst, 23 = default).
audio_kbps: u32Average audio bitrate in kbps (e.g. 128, 192, 320).
target_bitrate_kbps: Option<f64>Target bitrate override in kbps (used with TargetBitrate goal).
Implementations§
Source§impl TranscodeConfig
impl TranscodeConfig
Sourcepub fn new(
width: u32,
height: u32,
fps: f64,
duration_secs: f64,
crf: u8,
) -> Self
pub fn new( width: u32, height: u32, fps: f64, duration_secs: f64, crf: u8, ) -> Self
Creates a new transcode config.
Sourcepub fn estimated_size_mb(&self) -> f64
pub fn estimated_size_mb(&self) -> f64
Estimates the output file size in megabytes based on CRF, resolution and duration.
Uses a simplified empirical formula. Actual sizes vary by content.
Sourcepub fn pixel_count(&self) -> u64
pub fn pixel_count(&self) -> u64
Returns the pixel count (width × height).
Sourcepub fn is_4k_or_above(&self) -> bool
pub fn is_4k_or_above(&self) -> bool
Returns true if this config describes a 4K or larger resolution.
Trait Implementations§
Source§impl Clone for TranscodeConfig
impl Clone for TranscodeConfig
Source§fn clone(&self) -> TranscodeConfig
fn clone(&self) -> TranscodeConfig
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 TranscodeConfig
impl Debug for TranscodeConfig
Auto Trait Implementations§
impl Freeze for TranscodeConfig
impl RefUnwindSafe for TranscodeConfig
impl Send for TranscodeConfig
impl Sync for TranscodeConfig
impl Unpin for TranscodeConfig
impl UnsafeUnpin for TranscodeConfig
impl UnwindSafe for TranscodeConfig
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