OpenCV 3.0 VideoCapture doesn't open video file in Java

后端 未结 3 749
说谎
说谎 2021-01-14 18:07

OpenCV 3.0 with Java cannot open video file, but it woks with camera. Before I was using OpenCV 3.0-beta it was working well in both, but in OpenCV 3.0 which is released on

相关标签:
3条回答
  • 2021-01-14 18:47

    Even after adding C:\opencv\build\x64\vc12\bin to SYSTEM path, if you cannot open VideoCapture then you could also try coping opencv_ffmpegXXX_64.dll from opencv/build/java/x64 or from opencv\build\x64\vc14\bin. I don't know why this works but it worked for me after trying:

    https://stackoverflow.com/a/29920295/677185 and https://github.com/opencv/opencv/issues/4974

    0 讨论(0)
  • 2021-01-14 18:52

    I solved my problem like this: Copy the C:\opencv\build\x64\vc12\bin to the system path and restart the Eclipse.

    Hope this help someone that may has this problem with OpenCV 3.0.

    0 讨论(0)
  • 2021-01-14 18:55

    Generally opencv_ffmpegXXX.dll file not placed at opencvjavaXXX.dll file folder so you need to load two library in java code

    You should have try this.

    System.loadLibrary(Core.NATIVE_LIBRARY_NAME); // for OpencvjavaXXX.dll 
    
    System.loadLibrary("opencv_ffmpeg320_64"); // for OpenCV_ffmpegXXX.dll file 
    

    You can specify full DLL file path into the (string) parameter

    0 讨论(0)
提交回复
热议问题