pub struct VideoFingerprint {
pub video_id: u64,
pub keyframe_hashes: Vec<u64>,
pub temporal_hash: u64,
pub duration_ms: u64,
}Expand description
A compact fingerprint for a video.
Contains hashes of sampled keyframes plus a temporal hash that encodes the overall frame sequence order.
Fields§
§video_id: u64Unique identifier for this video.
keyframe_hashes: Vec<u64>Hashes of sampled keyframes.
temporal_hash: u64Temporal hash computed from the ordered keyframe sequence.
duration_ms: u64Duration in milliseconds.
Implementations§
Source§impl VideoFingerprint
impl VideoFingerprint
Sourcepub fn new(video_id: u64, keyframe_hashes: Vec<u64>, duration_ms: u64) -> Self
pub fn new(video_id: u64, keyframe_hashes: Vec<u64>, duration_ms: u64) -> Self
Create a new fingerprint.
Sourcepub fn compute_temporal_hash(frame_hashes: &[u64]) -> u64
pub fn compute_temporal_hash(frame_hashes: &[u64]) -> u64
Compute a temporal hash from an ordered sequence of frame hashes.
Accumulates with XOR and a left-rotation so order matters.
Sourcepub fn keyframe_similarity(&self, other: &Self) -> f32
pub fn keyframe_similarity(&self, other: &Self) -> f32
Estimate similarity to another fingerprint using set-intersection / union of keyframe hash sets.
Trait Implementations§
Source§impl Clone for VideoFingerprint
impl Clone for VideoFingerprint
Source§fn clone(&self) -> VideoFingerprint
fn clone(&self) -> VideoFingerprint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VideoFingerprint
impl Debug for VideoFingerprint
impl Eq for VideoFingerprint
Source§impl PartialEq for VideoFingerprint
impl PartialEq for VideoFingerprint
Source§fn eq(&self, other: &VideoFingerprint) -> bool
fn eq(&self, other: &VideoFingerprint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VideoFingerprint
Auto Trait Implementations§
impl Freeze for VideoFingerprint
impl RefUnwindSafe for VideoFingerprint
impl Send for VideoFingerprint
impl Sync for VideoFingerprint
impl Unpin for VideoFingerprint
impl UnsafeUnpin for VideoFingerprint
impl UnwindSafe for VideoFingerprint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
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 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>
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