A small library to access DirectShow compatible cameras through NodeJS
const dcam = require("directcam");
const fs = require("fs");
dcam.cameras(null, function(err, cams){
console.table(cams);
console.log("hello!");
dcam.grab(cams.Moniker, function(err, img){
fs.writeFileSync("img.jpg", img);
});
});
- All callback functions need to be in function(err, result){} format
returns an array of camera objects in the system to the callback function
Camera Object:
{
index: Number,
Name: string,
Moniker: string (device reference)
}
returns an image frame to the callback function