Why do I have the following error when using videoWriter.write()?
OpenCV Error: Assertion failed (image->depth == 8) in writeFrame, file /home/yxchng/OpenCV/modules/videoio/src/cap_ffmpeg.cpp, line 272
However, i am able to use imwrite() to write each frame.
Can I know how I can solve this problem?
Your image depth does not seem to fit.
videoWriter.write()
supports only 8bit images. If you store a .png or .tiff image withimwrite()
16bit images are supported, too. You could convert your image before using videoWriter.