BrianHepler / MMM-Selfieshot

Taking a Selfie with USB cam on MagicMirror.
MIT License
8 stars 6 forks source link

dark image #11

Closed Sam-Wo closed 3 years ago

Sam-Wo commented 3 years ago

Module works fine otherwise, but I get a dark image when I trigger. I think the issue is more the webcam. Read elsewhere that the problem is the webcam being triggered before it initialized. skipping the first few frames with fswebcam would solve, but I'm not sure how to add that here or where the fswebcam function is called since my javascript is very limited. Any ideas?

Sam-Wo commented 3 years ago

never mind, I found it. /home/pi/MagicMirror/modules/MMM-Selfieshot/node_modules/node-webcam/src/webcams/FSwebcam.js is the file that needs to be edited.

FSWebcam.prototype.bin = "fswebcam -S 20";

adding the -S 20 here skips the first 20 frames and lets the camera initialize.