pub struct SmartTrimEngine {
pub config: SmartTrimConfig,
}Expand description
Analyses clips and produces intelligent trim suggestions.
The analysis is based on heuristic rules derived from clip type and duration; a production implementation would replace these with signal-level analysis of the decoded media.
Fields§
§config: SmartTrimConfigTuning configuration.
Implementations§
Source§impl SmartTrimEngine
impl SmartTrimEngine
Sourcepub fn new_with_config(config: SmartTrimConfig) -> Self
pub fn new_with_config(config: SmartTrimConfig) -> Self
Create a smart trim engine with custom configuration.
Sourcepub fn analyze(&self, timeline: &Timeline) -> Vec<TrimSuggestion>
pub fn analyze(&self, timeline: &Timeline) -> Vec<TrimSuggestion>
Analyse all clips in timeline and return all trim suggestions above
the configured minimum confidence.
Sourcepub fn analyze_clip(&self, clip: &Clip) -> Vec<TrimSuggestion>
pub fn analyze_clip(&self, clip: &Clip) -> Vec<TrimSuggestion>
Produce trim suggestions for a single clip.
Returns suggestions based on clip type:
- Audio clips: silence-based in/out suggestions.
- Video clips: scene-boundary in-point and motion-stop out-point.
- Subtitle clips: no suggestions.
Sourcepub fn suggest_in_point(&self, clip: &Clip) -> Option<TrimSuggestion>
pub fn suggest_in_point(&self, clip: &Clip) -> Option<TrimSuggestion>
Return the highest-confidence in-point suggestion for clip, if any.
Sourcepub fn suggest_out_point(&self, clip: &Clip) -> Option<TrimSuggestion>
pub fn suggest_out_point(&self, clip: &Clip) -> Option<TrimSuggestion>
Return the highest-confidence out-point suggestion for clip, if any.
Sourcepub fn apply_suggestions(
&self,
timeline: &mut Timeline,
suggestions: &[TrimSuggestion],
) -> EditResult<usize>
pub fn apply_suggestions( &self, timeline: &mut Timeline, suggestions: &[TrimSuggestion], ) -> EditResult<usize>
Apply a set of trim suggestions to the timeline.
Only suggestions with confidence ≥ 0.75 are applied. Missing clips are silently skipped. Returns the number of suggestions applied.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SmartTrimEngine
impl RefUnwindSafe for SmartTrimEngine
impl Send for SmartTrimEngine
impl Sync for SmartTrimEngine
impl Unpin for SmartTrimEngine
impl UnsafeUnpin for SmartTrimEngine
impl UnwindSafe for SmartTrimEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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