Skip to main content

A package for hashing videos and checking for similarity

Project description

Vidhash

Vidhash is a perceptual video hashing and checking library, to detect similar videos, or videos containing similar scenes.

How it works

Basically, this video hashing works by scaling the video down a bit, and taking 5 frames a second as images, and performing image hashes on those frames. Then it can do checks by checking how many image hashes from one video match up with image hashes from another.

How to use

This documentation is a little sparse at the moment, but the basic summary is that to hash a video, use video_hash = hash_video(video_path).
This returns a VideoHash object.
You can also provide a HashSettings object. HashSettings need to match for two video hashes to be compared. Currently HashSettings allow specifying the

When checking video hashes against each-other, use video_hash.check_match(other_hash). You can optionally provide a MatchOptions object as a second argument, or use a MatchOptions object and call the MatchOptions.check_match(hash1, hash2) method on it.

There are 3 supported types of MatchSettings:

  • FrameCountMatch
    • Checks whether a specified number of frames match between the two videos
    • Allows specifying the hamming distance between two frames which should be considered a "match"
    • Allows ignoring blank frames
  • PercentageMatch
    • Checks whether a specified percentage of the shorter video's frames match the longer video
    • Allows specifying the hamming distance between two frames which should be considered a "match"
    • Allows ignoring blank frames
  • DurationMatch
    • Checks whether a specified "duration" of frames match up in order between the two videos
      • e.g. 3 seconds duration, at 5 fps, would check whether 15 frames match, in a row, between the two videos
    • Allows specifying the hamming distance between two frames which should be considered a "match"

Todo

  • Code
    • Wrapper for imagehash.ImageHash
    • Datastore
      • (For looking up matching videos from a collection)
  • More documentation
  • More tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vidhash-0.3.2.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vidhash-0.3.2-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file vidhash-0.3.2.tar.gz.

File metadata

  • Download URL: vidhash-0.3.2.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure

File hashes

Hashes for vidhash-0.3.2.tar.gz
Algorithm Hash digest
SHA256 5486eb602ac45d45690e0b32d4dfa7db0c4c2c5998f6889b88ea1c1f2100d713
MD5 0a6740e3315915e53a10b3bf47ce82ac
BLAKE2b-256 81e20c09c844d601e9c534abead68332446af6491bc68cf4277a27361dd70d37

See more details on using hashes here.

File details

Details for the file vidhash-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: vidhash-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure

File hashes

Hashes for vidhash-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb18c9c85acf2b11eebedc93ad4d960bb3066571e7e7c929dbd4efd637ffe76d
MD5 120e88f048115117928fba97310bd39d
BLAKE2b-256 73fd2a21107fae20ce9b65f73944d9ae6d7fae583ac1484d9c5e9917d5fcb713

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page