Problem capturing cam with external USB videocard

edited June 2016 in Library Questions

Good afternoon, I've a problem: I need to capture video from an external camera for my ROV. I've a camera (composite out) and an USB videocard, both working properly (I've checked them). I'm trying to use them in Processing with the following lines:

import processing.video.*;
Capture cam;
void setup() {
  size(640, 480);
  String[] cameras = Capture.list();  
  if (cameras.length == 0) {
    println("There are no cameras available for capture.");
    exit();
  } else {
    println("Available cameras:");
    for (int i = 0; i < cameras.length; i++) {
      println(cameras[i]);
    }    
    // The camera can be initialized directly using an 
    // element from the array returned by list():
    cam = new Capture(this, cameras[18]);
    cam.start();     
  }      
}
void draw() {
  if (cam.available() == true) {
    cam.read();
  }
  image(cam, 0, 0);
  // The following does the same, and is faster when just drawing the image
  // without any additional resizing, transformations, or tint.
  //set(0, 0, cam);
}

USB videocard is correctely listed (number 18) but, once started, Processing returns only gray screen and the following errors... how can I solve those problems??? The number code of the error changes everytime but the text of the error is always the same as follows... Thanks in advance, Andrew


**(java.exe:1796): GStreamer-CRITICAL **: Trying to dispose element rgb, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(java.exe:1796): GStreamer-CRITICAL **: Trying to dispose element Video Capture, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.**


Tagged:
Sign In or Register to comment.