pub struct Comparator<P: AsRef<Path>> { /* private fields */ }Expand description
Compares two or more video files using either existing FrameHashes or by running an Analyzer in-place.
Implementations§
Source§impl<P: AsRef<Path> + Ord> Comparator<P>
impl<P: AsRef<Path> + Ord> Comparator<P>
Sourcepub fn from_files(videos: impl Into<Vec<P>>) -> Self
pub fn from_files(videos: impl Into<Vec<P>>) -> Self
Constructs a Comparator from a list of video paths.
Source§impl<P: AsRef<Path>> Comparator<P>
impl<P: AsRef<Path>> Comparator<P>
Sourcepub fn with_openings_only(self, openings_only: bool) -> Self
pub fn with_openings_only(self, openings_only: bool) -> Self
Returns a new Comparator with the provided openings_only.
Sourcepub fn with_hash_match_threshold(self, hash_match_threshold: u32) -> Self
pub fn with_hash_match_threshold(self, hash_match_threshold: u32) -> Self
Returns a new Comparator with the provided hash_match_threshold.
Sourcepub fn with_opening_search_percentage(
self,
opening_search_percentage: f32,
) -> Self
pub fn with_opening_search_percentage( self, opening_search_percentage: f32, ) -> Self
Returns a new Comparator with the provided opening_search_percentage.
Sourcepub fn with_ending_search_percentage(
self,
ending_search_percentage: f32,
) -> Self
pub fn with_ending_search_percentage( self, ending_search_percentage: f32, ) -> Self
Returns a new Comparator with the provided ending_search_percentage.
Sourcepub fn with_min_opening_duration(self, min_opening_duration: Duration) -> Self
pub fn with_min_opening_duration(self, min_opening_duration: Duration) -> Self
Returns a new Comparator with the provided min_opening_duration.
Sourcepub fn with_min_ending_duration(self, min_ending_duration: Duration) -> Self
pub fn with_min_ending_duration(self, min_ending_duration: Duration) -> Self
Returns a new Comparator with the provided min_ending_duration.
Sourcepub fn with_time_padding(self, time_padding: Duration) -> Self
pub fn with_time_padding(self, time_padding: Duration) -> Self
Returns a new Comparator with the provided time_padding.
Source§impl<P: AsRef<Path> + Sync> Comparator<P>
impl<P: AsRef<Path> + Sync> Comparator<P>
Sourcepub fn run_with_frame_hashes(
&self,
frame_hashes: Vec<FrameHashes>,
display: bool,
use_skip_files: bool,
write_skip_files: bool,
threading: bool,
) -> Result<BTreeMap<PathBuf, SearchResult>>
pub fn run_with_frame_hashes( &self, frame_hashes: Vec<FrameHashes>, display: bool, use_skip_files: bool, write_skip_files: bool, threading: bool, ) -> Result<BTreeMap<PathBuf, SearchResult>>
Exactly the same as Self::run, but uses the provided FrameHashes instead of reading from disk or analyzing in-place.
Note that the provided FrameHashes must be generated from an Analyzer using the same list of video paths.
Sourcepub fn run(
&self,
analyze: bool,
display: bool,
use_skip_files: bool,
write_skip_files: bool,
threading: bool,
) -> Result<BTreeMap<PathBuf, SearchResult>>
pub fn run( &self, analyze: bool, display: bool, use_skip_files: bool, write_skip_files: bool, threading: bool, ) -> Result<BTreeMap<PathBuf, SearchResult>>
Runs the comparator.
- If
analyzeis set to true, anAnalyzerwill be built for each video file and run in-place. - If
use_skip_filesis set, if a skip file already exists for a video, the video will be skipped during this run. Ifwrite_skip_filesis set, a skip file will be written to disk once the comparator is completed. - If
displayis set, the final results will be printed to stdout.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for Comparator<P>
impl<P> RefUnwindSafe for Comparator<P>where
P: RefUnwindSafe,
impl<P> Send for Comparator<P>where
P: Send,
impl<P> Sync for Comparator<P>where
P: Sync,
impl<P> Unpin for Comparator<P>where
P: Unpin,
impl<P> UnwindSafe for Comparator<P>where
P: UnwindSafe,
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> 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