opencv4nodejs: Error: VideoCapture::New - failed to open capture

const cap = new cv.VideoCapture('./roadtest1.mp4');
// Error: VideoCapture::New - failed to open capture

I get the same results with an RTSP stream as well.

This is on version 4.5.1 (autobuilt) on a fresh Ubuntu install, the only things i’ve installed are Node 8.11.2 and cmake (following these instructions).

I have not installed OpenCV independently at all.

I can do things like this, no problem:

const img = new cv.Mat();

Any ideas?!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

Hi Content of my docker file:

FROM m03geek/ffmpeg-opencv-dlib-node:alpine
RUN apk update && apk add -u --no-cache python make g++ git
WORKDIR /app
COPY package.json /app
RUN npm install
RUN npm install pm2 -g
COPY . /app
CMD ["pm2-runtime", "ecosystem.config.js", "--only", "my-app-name"]

opencv4nodejs is listed in package.json