Struct Comparator

Source
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>

Source

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>

Source

pub fn videos(&self) -> &[P]

Returns the video paths used by this comparator.

Source

pub fn with_openings_only(self, openings_only: bool) -> Self

Returns a new Comparator with the provided openings_only.

Source

pub fn with_hash_match_threshold(self, hash_match_threshold: u32) -> Self

Returns a new Comparator with the provided hash_match_threshold.

Source

pub fn with_opening_search_percentage( self, opening_search_percentage: f32, ) -> Self

Returns a new Comparator with the provided opening_search_percentage.

Source

pub fn with_ending_search_percentage( self, ending_search_percentage: f32, ) -> Self

Returns a new Comparator with the provided ending_search_percentage.

Source

pub fn with_min_opening_duration(self, min_opening_duration: Duration) -> Self

Returns a new Comparator with the provided min_opening_duration.

Source

pub fn with_min_ending_duration(self, min_ending_duration: Duration) -> Self

Returns a new Comparator with the provided min_ending_duration.

Source

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>

Source

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.

Source

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 analyze is set to true, an Analyzer will be built for each video file and run in-place.
  • If use_skip_files is set, if a skip file already exists for a video, the video will be skipped during this run. If write_skip_files is set, a skip file will be written to disk once the comparator is completed.
  • If display is set, the final results will be printed to stdout.

Trait Implementations§

Source§

impl<P: Debug + AsRef<Path>> Debug for Comparator<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: AsRef<Path>> Default for Comparator<P>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<P: AsRef<Path>> From<Analyzer<P>> for Comparator<P>

Source§

fn from(analyzer: Analyzer<P>) -> Self

Constructs a Comparator from an Analyzer. This allows you to re-use the paths and destroy the Analyzer when you’re done with it.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more