node-opencv
node-opencv copied to clipboard
TypeError: cv.VideoWriter is not a constructor
Hi,
I have this error,
TypeError: cv.VideoWriter is not a constructor
on trying the following example node-opencv/examples/write-video.js
And I don't understand why :(
Thank you, Mathieu
Ok you need to install the available-modules branch to use these functions.
npm install [...].git#available-modules
Can you elaborate what steps you took to resolve the issue? Thank you!!
available modules is now in the master branch; but you will need to install from github; npm is vanilla 6.0.0 which may not have the support.
npm install peterbraden/node-opencv
be aware that VideoWriter depends upon 'HAVE_OPENCV_VIDEOIO' - so this must have been set in the build of OpenCV itself, else it will be excluded when node-opencv builds.
using a relative std OpenCV 3.3.0 built with opencv-contrib, I successfully use:
writer = new cv.VideoWriter(filename, 'MP42' /*'DIVX'*/, FPS, msg.camera.size(), true);
which seems to produce mpeg4 in AVI relatively efficiently on an RPi3.
In terms of building opencv, I roughly documented what i did here node-opencv-with-node-red, in case it's any use