pub struct VideoSegmentDeduplicator { /* private fields */ }Expand description
Finds duplicate video segments across a collection of indexed videos.
Each video is represented as an ordered sequence of SegmentFingerprints.
The deduplicator compares all pairs of fingerprint sequences and reports
segment-level matches above a configurable similarity threshold.
Implementations§
Source§impl VideoSegmentDeduplicator
impl VideoSegmentDeduplicator
Sourcepub fn with_threshold(threshold: f32) -> Self
pub fn with_threshold(threshold: f32) -> Self
Create a deduplicator with a custom similarity threshold.
Sourcepub fn add_video(
&mut self,
video_id: &str,
fingerprints: Vec<SegmentFingerprint>,
)
pub fn add_video( &mut self, video_id: &str, fingerprints: Vec<SegmentFingerprint>, )
Register a video’s fingerprint sequence.
Sourcepub fn video_count(&self) -> usize
pub fn video_count(&self) -> usize
Returns the number of indexed videos.
Sourcepub fn find_duplicate_segments(&self) -> Vec<SegmentMatch>
pub fn find_duplicate_segments(&self) -> Vec<SegmentMatch>
Find all matching segment pairs across all indexed videos.
Performs pairwise comparison between each combination of (video_a, segment_i) × (video_b, segment_j) for all distinct video pairs. Within-video self-comparisons are skipped.
Uses the deduplicator’s configured threshold.
Sourcepub fn find_duplicate_segments_with_threshold(
&self,
threshold: f32,
) -> Vec<SegmentMatch>
pub fn find_duplicate_segments_with_threshold( &self, threshold: f32, ) -> Vec<SegmentMatch>
Find matching segment pairs using an explicit similarity threshold.
Sourcepub fn query(
&self,
video_id: &str,
fingerprints: &[SegmentFingerprint],
threshold: f32,
) -> Vec<SegmentMatch>
pub fn query( &self, video_id: &str, fingerprints: &[SegmentFingerprint], threshold: f32, ) -> Vec<SegmentMatch>
Find matches between a newly submitted video and all indexed videos without permanently adding it to the index.
Trait Implementations§
Source§impl Debug for VideoSegmentDeduplicator
impl Debug for VideoSegmentDeduplicator
Source§impl Default for VideoSegmentDeduplicator
impl Default for VideoSegmentDeduplicator
Source§fn default() -> VideoSegmentDeduplicator
fn default() -> VideoSegmentDeduplicator
Auto Trait Implementations§
impl Freeze for VideoSegmentDeduplicator
impl RefUnwindSafe for VideoSegmentDeduplicator
impl Send for VideoSegmentDeduplicator
impl Sync for VideoSegmentDeduplicator
impl Unpin for VideoSegmentDeduplicator
impl UnsafeUnpin for VideoSegmentDeduplicator
impl UnwindSafe for VideoSegmentDeduplicator
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> 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