Can't open video files - Java + OpenCV

asked 2016-11-23 11:48:56 -0600

AcProblem gravatar image

updated 2016-11-23 12:44:38 -0600

videoInput.isOpened() is always false when loading video files. I'm on Windows 7 64 bit and using eclipse, things I've tried to fix it:

  • Adding "opencv_ffmpeg310_64.dll" pretty much everywhere
  • Added the PATH variable
  • Tried different versions of OpenCV (using 3.1)

    public static void main(String[] args) {
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    
    //Load image from video
    String videoURL = "C:/Users/Adam/Desktop/fulltest.mp4";
    VideoCapture videoInput = new VideoCapture("C:/Users/Adam/Desktop/fulltest.mp4");
    if(videoInput.isOpened()) {
        Mat frame = new Mat();
        videoInput.read(frame);
        BufferedImage frameImage = Mat2BufferedImage(frame);  
    
    
        DemoUI test = new DemoUI(frameImage);   
    } else {System.out.println("Broken");}
    }
    
edit retag flag offensive close merge delete