pub struct FrameTrimConfig {
pub fps_num: u32,
pub fps_den: u32,
pub total_source_frames: Option<u64>,
pub ranges: Vec<TrimRange>,
}Expand description
Complete frame-accurate trim / multi-cut configuration for a transcode job.
Multiple TrimRange entries create a cut list — the pipeline concatenates
only the segments that correspond to each range.
Fields§
§fps_num: u32Source frame rate numerator.
fps_den: u32Source frame rate denominator.
total_source_frames: Option<u64>Total frame count of the source (used for bounds checking).
ranges: Vec<TrimRange>Ordered list of ranges to include in the output.
Implementations§
Source§impl FrameTrimConfig
impl FrameTrimConfig
Sourcepub fn new(fps_num: u32, fps_den: u32) -> Self
pub fn new(fps_num: u32, fps_den: u32) -> Self
Creates a new trim config for the given frame rate.
Sourcepub fn total_frames(self, n: u64) -> Self
pub fn total_frames(self, n: u64) -> Self
Sets the total frame count for bounds checking.
Sourcepub fn validate_and_resolve(&self) -> Result<Vec<ResolvedTrimRange>>
pub fn validate_and_resolve(&self) -> Result<Vec<ResolvedTrimRange>>
Validates all ranges and returns resolved ranges sorted by in-point.
§Errors
Returns an error if any range is invalid or if ranges overlap.
Sourcepub fn total_output_frames(&self) -> Result<u64>
pub fn total_output_frames(&self) -> Result<u64>
Returns the total output frame count across all ranges.
§Errors
Returns an error if validation fails.
Sourcepub fn total_output_duration_ms(&self) -> Result<u64>
pub fn total_output_duration_ms(&self) -> Result<u64>
Sourcepub fn should_include_frame(&self, frame: u64) -> bool
pub fn should_include_frame(&self, frame: u64) -> bool
Returns true if the given source frame should be included in the output.
Pre-resolves ranges lazily; panics-safe (returns false on error).
Trait Implementations§
Source§impl Clone for FrameTrimConfig
impl Clone for FrameTrimConfig
Source§fn clone(&self) -> FrameTrimConfig
fn clone(&self) -> FrameTrimConfig
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 FrameTrimConfig
impl RefUnwindSafe for FrameTrimConfig
impl Send for FrameTrimConfig
impl Sync for FrameTrimConfig
impl Unpin for FrameTrimConfig
impl UnsafeUnpin for FrameTrimConfig
impl UnwindSafe for FrameTrimConfig
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