Can't Open Video Device [Java]

asked 2017-04-21 15:21:42 -0600

gudenau gravatar image

I am trying to open my "Elgato HD60 Pro" with the 3.2.0 WinPack using a 64 bit JDK. I am running version 1.8.0_121 of Java.

This is the code that I am using:

import org.opencv.core.Core;
import org.opencv.videoio.VideoCapture;

public class Test{
    static {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    }

    public static void main(String[] arguments){
        VideoCapture videoCapture = new VideoCapture();
        videoCapture.open(0);

        try{
            Thread.sleep(1000);
        }catch(InterruptedException e){
            e.printStackTrace();
        }

        System.out.println(videoCapture.isOpened());
    }
}

When it runs I always get "false" even when using VideoCapture.<init>(I)V to specify the index. I have tried from 0-3 and each one returns false. I have made sure that no other device is accessing the capture card as well.

What am I doing wrong?

edit retag flag offensive close merge delete