chuckfairy / node-webcam

Nodejs Cross Platform Webcam usage
MIT License
193 stars 51 forks source link

Not taking more than 3 shots #64

Closed gohoski closed 2 years ago

gohoski commented 2 years ago

Hello, On Windows 10, I can't make more than 3 shots. After creating 3 photos, the script freezes on this command:

"D:\webcamTest\node_modules\node-webcam\src\bindings\CommandCam\CommandCam.exe"   /filename 4GyC-AvEFRr-2z3L7VZnT.bmp

My code:

app.get('/webcam.bmp', async (req, res) => {
  var Webcam = NodeWebcam.create({
    frames: 60,
    device: false,
    callbackReturn: 'buffer',
    verbose: true
  });
  Webcam.capture(`${nanoid()}.bmp`, async (err, data) => {
    res.send(data);
  })
})

Can you help me?

gohoski commented 2 years ago

Ah, so I forgot to do Webcam.clear() before the shot.