What is Videohash and how does it work?
mainVideohash is a Python package for Perceptual Video Hashing, designed to detect near-duplicate videos. Unlike standard checksums, it generates a 64-bit hash that remains stable even if the video is resized, transcoded, watermarked, or has its color/frame rate/aspect ratio changed.
How it works
- A frame is extracted every second.
- Frames are resized to a 144x144 square and arranged into a collage.
- A wavelet hash is calculated from this collage.
- The frames are stitched horizontally and divided into 64 images; the dominant color of each is compared to a pattern to create a second bit-list.
- The final 64-bit hash is generated by bitwise XORing these two bit-lists.