Last active
February 23, 2017 13:15
-
-
Save carlozamagni/5c84da26ddef2a7c01f04cabad387736 to your computer and use it in GitHub Desktop.
NodeJs timelapse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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