-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcam.js
More file actions
32 lines (25 loc) · 689 Bytes
/
cam.js
File metadata and controls
32 lines (25 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var NodeWebcam = require( "node-webcam" );
var opts = {
width: 1280,
height: 720,
quality: 100,
delay: 0,
saveShots: true,
output: "jpeg",
device: false,
verbose: true,
// [location, buffer, base64]
// Webcam.CallbackReturnTypes
callbackReturn: "location",
};
var FSWebcam = NodeWebcam.FSWebcam;
var cam = new FSWebcam(opts);
cam.capture("test_picture", function( err, data ) {
console.log(err, data);
} );
/* Webcam.list( function( list ) {
var anotherCam = NodeWebcam.create( { device: list[ 0 ] } );
}); */
/* NodeWebcam.capture( "test_picture", opts, function( err, data ) {
var image = "<img src='" + data + "'>";
}); */