README
video-scene-groups
Find groups of scenes in an array of phashes using hierarchical clustering Pretty raw data, so you'll need to format the results yourself.
API
var detect = require('video-scene-groups');
var Extract = require('video-extract');
var extract = Extract('video.mp4');
extract.phashes.then(function (phashes) {
var levels = detect(phashes)
var last = levels[levels.length - 1]
var clusters = last.clusters.filter(function (cluster) {
return cluster.length > 1 // not really a group, otherwise
}).map(function (cluster) {
return cluster.sort() // sort by index, ascending
})
// clusters are arrays of frames in a scene group
// you want to calculate scenes and match it with scene groups
})
var levels = detect(phashes, [threshold])
phashes
- array of phashesthreshold
- maximum phash distance to cluster with