Have ideas to improve npm?Join in the discussion! »

video-scene-groups

1.0.0 • Public • Published

video-scene-groups

NPM version Build status Test coverage Dependency Status License Downloads Gittip

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 phashes
  • threshold - maximum phash distance to cluster with

Install

npm i video-scene-groups

DownloadsWeekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar