Question

I am Getting error when run the program the error as follows

com.googlecode.javacv.FrameGrabber$Exception: videoInput.getPixels() Error: Could not get pixels.
    at com.googlecode.javacv.VideoInputFrameGrabber.grab(VideoInputFrameGrabber.java:168)
    at Robot.run(Robot.java:107)
    at java.lang.Thread.run(Unknown Source)

***** VIDEOINPUT LIBRARY - 0.1995 - TFW07 *****

SETUP: Setting up device 0
SETUP: HD Pro Webcam C920
SETUP: Couldn't find preview pin using SmartTee
SETUP: Capture callback set
SETUP: Device is setup and ready to capture.

And Error Shown in the line as below

rameGrabber grabber = new VideoInputFrameGrabber(0); // 1 for next camera

grabber.start();
        IplImage img = null;
        while (true) {
             long sleepTime= (long)((100000 / 60));
             Thread.sleep(sleepTime);
                img = grabber.grab();//gettin error on this line..
Was it helpful?

Solution

I am having similar problem with this. The answer is in this forum (https://groups.google.com/forum/#!msg/javacv/yD99RSl7oCI/KQIRoOIqcK4J)

try using javaCV.OpenCVFrameGrabber instead of VideoInputFrameGrabber.

Change the line 'FrameGrabber grabber = new VideoInputFrameGrabber(0); // 1 for next camera'

to 'FrameGrabber grabber = new OpenCVFrameGrabber(0); // 1 for next camera'

now it works for me everytime.

Hope it helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top