Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: VideoCapture::New - failed to open capture" on raspberry pi #631

Open
JeremyKirkham opened this issue Jun 7, 2018 · 2 comments
Open

Comments

@JeremyKirkham
Copy link

I've added the opencv4nodejs library to my raspberry pi package, I'm trying to access the picam 2 video camera. The script I'm running is as following:

import * as cv from 'opencv4nodejs'

async function main() {
  const wCap = new cv.VideoCapture(0);
  const intvl = setInterval(() => {
    let frame = wCap.read();
    // loop back to start on end of stream reached
    if (frame.empty) {
      wCap.reset();
      frame = wCap.read();
    }
    console.log(frame);
  }, 0);
}

main()

FWIW, I'm running this inside docker on a raspberry pi 3b+, using resin.io to deploy the images.

@riccardolardi
Copy link

riccardolardi commented Aug 31, 2018

Did you find any solution to this @JeremyKirkham ? I'm having the same issue on a Raspberry Pi 3 B. I think it has to do with missing dependencies, ffmpeg or v4l2... though not sure

@alcalawil
Copy link

sudo modprobe bcm2835-v4l2 Worked to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants