phash2
v1.1.0
Published
node wrapper for pHash
Downloads
4
Maintainers
Readme
Node pHash Wrapper
A wrapper for pHash using N-API and Promises.
Supported:
- Images (DCT and MH hashses, and respective hamming distance calculators)
- Video (DCT hashing and distance calculator). Note that this segfaults in pHash. Possibly due to deprecated ffmpeg code.
Usage
For API documentation please see types/index.d.ts.
Also see test.js for an example usage.
TypeScript
import pHash from 'phash2';
console.log(pHash.info());
NodeJS
const pHash = require('phash2');
console.log(pHash.info());
Installing pHash
See the Dockerfiles under dev for Alpine and Ubuntu setup.
Ubuntu
sudo apt-get install -y git libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libsndfile-dev libsamplerate-dev libtiff-dev g++ make cmake
git clone https://github.com/aetilius/pHash
mkdir build && cd build
cmake -DWITH_AUDIO_HASH=ON -DWITH_VIDEO_HASH=ON ../pHash
make -j8
sudo make install