justadudewhohacks / justadudewhohacks/opencv4nodejs
Error: VideoCapture::New - failed to open capture with Docker and http stream
- Dominant language
- C++
- Stars
- 5.1k
- Forks
- 826
- PR merge metrics
- No merged PRs in 30d
Description
So I've been trying to get this to work in Docker for a few days now, but no matter what I keep getting this error:
`Error: VideoCapture::New - failed to open capture`
which originates from trying to read an http stream from an IP camera:
`new cv.VideoCapture('http://10.134.130.94/axis-cgi/mjpg/video.cgi');`
This worked without issue with Windows 10. I'm also able to ping the IP address and make a Curl request from inside the container. So I've concluded this is probably an issue with the build process. This was my original Dockerfile:
```
FROM node:10
WORKDIR /app
RUN apt-get update && apt-get -y install cmake
COPY package*.json ./
RUN npm i --only=prod
COPY . .
EXPOSE 9452
EXPOSE 9453
CMD ["npm", "start"]
```
I've also tried installing additional ffmeg packages:
`apt-get install cmake ffmpeg && apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev -y`
I also tried using the [Docker build script in the repository](https://github.com/justadudewhohacks/opencv4nodejs-docker-images/tree/master/opencv-nodejs).
Has anyone been able to successfully use this with Docker, especially with http streams?
Contributor guide
Research direction
Start with the Dockerfile shown in the issue and compare it with the repository's opencv-nodejs Docker build script. Reproduce the `cv.VideoCapture` HTTP-stream failure inside Docker, then determine whether a project-level build or image change is needed; completion requires a confirmed working configuration or a documented diagnosis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, javascript, nodejs
- 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