Loading...
Logo
Processing Forum
Hello,

I'm working on an iMac and trying to capture video from a webcam other than the iSight. I've got iPhone software webcams installed (iWebCamera) that were being recognized in Processing 1.5.1 but are not recognized in Processing 2.0b6. 
When I println with the code below it just shows iSight webcam listings. If I disable the iSight, it finds no capture devices.
I've tried reinstalling the drivers but that did not help.
Any ideas/suggestions would be greatly appreciated. Code below.
Thanks,
Brent

import processing.video.*;
Capture cam;

void initVideo() {
  //If no device is specified, will just use the default.
  //cam = new Capture(this, 320, 240);

  // To use another device (i.e. if the default device causes an error),  
  // list all available capture devices to the console to find your camera.
  String[] devices = Capture.list();
  println(devices);
  
  // Change devices[0] to the proper index for your camera.
  cam = new Capture(this, width, height, 30);
  cam.start();
  // Opens the settings page for this capture device.
  //camera.settings();
}
void drawVideo() {
  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(160, 100, cam);
  }

Replies(5)

Try setting Processing to run in 32-bit mode
Thanks Jesse, but no luck. I tried it in 32 and 64-bit mode, and it doesn't recognize anything but the iSight.
The video library underwent several changes from 1.x to 2.0... the most significant was the replacement of quicktime by gstreamer as the underlying multimedia framework. The latter allows for faster movie playback from Processing, unfortunately it doesn't provide support for capture devices under OSX as extensive as quicktime does...
Thanks Andres.
Does that mean there are no workarounds for this right now?
Apparently, it is possible to get the iPhone to work as a camera through gstreamer, some relevant info here and here. But the video library in Processing doesn't allow you to create custom video pipelines as in the example... GSVideo is and older video library that is the basis for the new video library in Processing 2.0, and it includes the pipeline functionality, but it might still be tricky to make it work properly, specially since the examples are Linux-based.