Wansview webcam controller for direction and taking pictures
Only tested with Wansview NC541W
npm install wansview
var Webcam = require('wansview')
var webcam = new Webcam('192.168.1.178', 'admin', '123456')
webcam.left()
setTimeout(function(){
webcam.stop()
webcam.snapshot('leftUp.png')
}, 5000)
Movement:
webcam.up()
webcam.down()
webcam.left()
webcam.right()
webcam.rightUp()
webcam.rightDown()
webcam.leftUp()
webcam.leftDown()
Panning:
webcam.panHorizontal()
webcam.panVertical()
Take picture:
webcam.snapshot() // returns a stream
Stream multiple images:
webcam.jpegStream() // returns a stream
Control the webcam movement from an xbox controller:
var XboxController = require('xbox-controller'),
fs = require('fs');
var xbox = new XboxController
var Webcam = require('wansview')
var webcam = new Webcam('192.168.1.178', 'admin', '123456')
var arrows = ["dup","ddown", "dleft", "dright"]
arrows.forEach(function(element, index, array) {
xbox.on(element + ':press', function (key) {
webcam[element.slice(1)]()
});
xbox.on(element + ':release', function (key) {
webcam.stop()
});
})
xbox.on('a:press', function (key) {
webcam.snapshot.pipe(fs.createWriteStream((new Date).toString() + '.png'));
});
Copyright (c) 2013 Andrew Nesbitt. See LICENSE for details.