Webcam with Node.js
js
Node.js
// install with npm node-webcam
let NodeWebcam = require( "node-webcam" );
let fs = require("fs");
let opts1 = {
width: 1280,
height: 720,
quality: 100,
delay: 0,
saveShots: false,
output: "jpeg",
device: false,
verbose: false,
callbackReturn: "base64"
};
NodeWebcam.capture( "test_picture", opts1, function( err, data ) {
let imagehtml = "<img src='" + data + "'>";
fs.writeFile("image.html", imagehtml, (err) => { if(err) throw err });
});