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.
For API documentation please see types/index.d.ts.
Also see test.js for an example usage.
import pHash from 'phash2';
console.log(pHash.info());
const pHash = require('phash2');
console.log(pHash.info());
See the Dockerfiles under dev for Alpine and Ubuntu setup.
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