Opencv open a video files but capture isOpened always falses

馋奶兔 提交于 2020-01-01 07:21:16

问题


I tried to use opencv java interface to capture the video, I find isOpened is always false.

I have tried different video format and different version (2.4.11 and 3.0.0), both met the same issues.

I have configure "-Djava.library.path=D:\Project\opencv\opencv3.0\build\x64\vc12\bin", and have copied opencv_java300.dll to this folder.

And I checked tips OpenCV 3.0 VideoCapture doesn't open video file in Java and OpenCV 2.4 VideoCapture not working on Windows, neither works for me.

Anyone knows what's the trick part to capture the video?

The sample code I have is:

    VideoCapture capture=new VideoCapture();
    capture.open("D:\\StopMoti2001.mpeg");
    if(!capture.isOpened()){
        return;
    }

回答1:


I have had the same issue but thanks tou your comments I have figured it out. For anyone intrested in the solution: copy opencv_ffmpeg310_64.dll from opencv/build/java/x64 folder to your project main folder (containing folders: src, .settings, bin).



来源:https://stackoverflow.com/questions/32155817/opencv-open-a-video-files-but-capture-isopened-always-falses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!