pub struct FixedDurationStrategy {
pub chunk_duration: Duration,
pub snap_tolerance: Duration,
pub reassembly: ReassemblyPlan,
pub timeout_multiplier: f64,
}Expand description
Split media at fixed duration intervals.
Simple strategy that creates equal-sized chunks. Chunk boundaries are snapped to the nearest provided boundary point (keyframe/silence).
Fields§
§chunk_duration: DurationTarget duration per chunk.
snap_tolerance: DurationMaximum allowed deviation from target when snapping to boundaries.
reassembly: ReassemblyPlanHow to reassemble chunks.
timeout_multiplier: f64Timeout multiplier per chunk (based on chunk duration).
Implementations§
Source§impl FixedDurationStrategy
impl FixedDurationStrategy
Sourcepub fn with_chunk_duration(self, duration: Duration) -> Self
pub fn with_chunk_duration(self, duration: Duration) -> Self
Create a strategy with the given chunk duration.
Sourcepub fn with_snap_tolerance(self, tolerance: Duration) -> Self
pub fn with_snap_tolerance(self, tolerance: Duration) -> Self
Set the snap tolerance.
Sourcepub fn with_reassembly(self, reassembly: ReassemblyPlan) -> Self
pub fn with_reassembly(self, reassembly: ReassemblyPlan) -> Self
Set the reassembly plan.
Sourcepub fn with_timeout_multiplier(self, multiplier: f64) -> Self
pub fn with_timeout_multiplier(self, multiplier: f64) -> Self
Set the timeout multiplier.
Trait Implementations§
Source§impl ChunkStrategy for FixedDurationStrategy
impl ChunkStrategy for FixedDurationStrategy
Source§fn plan(
&self,
metadata: &MediaMetadata,
boundaries: &[ChunkBoundary],
) -> AppResult<ChunkedOperation>
fn plan( &self, metadata: &MediaMetadata, boundaries: &[ChunkBoundary], ) -> AppResult<ChunkedOperation>
Plan chunk boundaries for the given media. Read more
Source§fn min_duration(&self) -> Option<Duration>
fn min_duration(&self) -> Option<Duration>
Minimum duration below which chunking is not worthwhile.
Returns
None if this strategy always chunks.Auto Trait Implementations§
impl Freeze for FixedDurationStrategy
impl RefUnwindSafe for FixedDurationStrategy
impl Send for FixedDurationStrategy
impl Sync for FixedDurationStrategy
impl Unpin for FixedDurationStrategy
impl UnsafeUnpin for FixedDurationStrategy
impl UnwindSafe for FixedDurationStrategy
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