justadudewhohacks / justadudewhohacks/opencv4nodejs

Error: VideoCapture::New - failed to open capture running with docker

Open
#620 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

Newbie trying to use docker-compose build, Please help. Code was running ok without docker. Changed a few lines to run docker.

I set import like the examples `global.cv = require(' /usr/lib/node_modules/opencv4nodejs')` and I used `FROM justadudewhohacks/opencv-nodejs:node9-opencv3.4.1-contrib` in the Dockerfile. I also deleted the line from package.json file. But I get following error
```
const wCap = new cv.VideoCapture(0);
docker_seller | ^
docker_seller |
docker_seller | Error: VideoCapture::New - failed to open capture
docker_seller | at Object. (/seller/index.js:11:14)
docker_seller | at Module._compile (module.js:649:30)
docker_seller | at Object.Module._extensions..js (module.js:660:10)
docker_seller | at Module.load (module.js:561:32)
docker_seller | at tryModuleLoad (module.js:501:12)
docker_seller | at Function.Module._load (module.js:493:3)
docker_seller | at Function.Module.runMain (module.js:690:10)
docker_seller | at startup (bootstrap_node.js:194:16)
docker_seller | at bootstrap_node.js:666:3

```

*OpenCV version* v10.16.1

*With OpenCV-contrib?* (extra modules): yes/no?

*OS*: MacOSX

Contributor guide

Open the contributing guide

Research direction

Start with the failing call at /seller/index.js:11, then inspect the Dockerfile, docker-compose configuration, and package.json changes described in the issue. Reproduce the Docker run and compare it with the non-Docker setup. Done means VideoCapture(0) opens successfully in the container without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, node.js, opencv
Domain
computer-vision, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.