Skip to content

Instantly share code, notes, and snippets.

@carlozamagni
Last active February 23, 2017 13:15
Show Gist options
  • Save carlozamagni/5c84da26ddef2a7c01f04cabad387736 to your computer and use it in GitHub Desktop.
Save carlozamagni/5c84da26ddef2a7c01f04cabad387736 to your computer and use it in GitHub Desktop.
NodeJs timelapse
'use strict'
const NodeWebcam = require( "node-webcam" );
var opts = {
width: 1280,
height: 720,
delay: 0,
quality: 100,
output: "jpeg",
verbose: true
}
var Webcam = NodeWebcam.create( opts )
var counter = 0
setInterval(function(){
let imgName = './shots/pic_' + counter + '.jpeg'
Webcam.capture(imgName)
counter++
}, 15000)
// require('child_process').spawn("ffmpeg", ["-framerate", "1", "-pattern_type", "glob", "-i", inputPath + 'img*.jpg', "-vf", "crop=((in_w/2)*2):((in_h/2)*2)", "-c:v", "libx264", outputPath + "out.mp4"]);
// https://github.com/mapbox/pixelmatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment