opencv 4.5.2 videowriter产生“找不到起始编号”错误

lvmkulzt  于 2021-07-09  发布在  Java
关注(0)|答案(0)|浏览(3034)

有几个问题的名字相似,但似乎没有一个明确的答案。在Windows10上使用最新版本的opencv 4.5.2和java。下面是一个简短的可重复的测试用例,它导致

[ERROR:0] global C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap.cpp (589) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.2) C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): C:/testfiles/output.avi in function 'cv::icvExtractPattern'

代码如下:

public class OpenCVError {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        final int fourcc = VideoWriter.fourcc('m', 'j', 'p', 'g');
        final double fps = 30.00;
        Size frameSize = new Size(1080, 1920);
        VideoWriter videoWriter = new VideoWriter("C:/testfiles/output.avi", fourcc, fps, frameSize, true);
    }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题