Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
/ wansview Public archive

[UNMAINTAINED] Wansview webcam controller for direction and taking pictures

License

Notifications You must be signed in to change notification settings

andrew/wansview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wansview

Wansview webcam controller for direction and taking pictures

Only tested with Wansview NC541W

Install

npm install wansview

Usage

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)

Commands

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

Example

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'));
});

Rabbit tracking webcam

Copyright

Copyright (c) 2013 Andrew Nesbitt. See LICENSE for details.

About

[UNMAINTAINED] Wansview webcam controller for direction and taking pictures

Resources

License

Stars

Watchers

Forks

Packages

No packages published