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.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

vidhash-0.3.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vidhash-0.3.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.8.18 Linux/6.5.0-1025-azure

File hashes

Hashes for vidhash-0.3.1.tar.gz
Algorithm Hash digest
SHA256 644681325d86e03fbc427c0c2c57f170e46ad7c0786e8f24e7d3daab6e278693
MD5 7d868bc5893a2a5b899fd9d64fbd7cef
BLAKE2b-256 ced9989801bdafdde6282aec04d3bbb571ab2018c2654f31d2c9d07220769b8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vidhash-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.8.18 Linux/6.5.0-1025-azure

File hashes

Hashes for vidhash-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4a4e74c7384d9791146ca5ddbededd7e268647f73f8bf90060de8c67eac87f0
MD5 2d59008b5d39e30ac4b9051457fe41f1
BLAKE2b-256 70e049a40083094ccd5daeffb44167445023061034bfa1c94afff7f0f1b2d1b6

See more details on using hashes here.

Supported by

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