We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey there,
I want to run my video cam on my Surface 3 in a sketch and have used the Capture class notes to do so but to no avail. I don't get an error msg or any text in the box rather just a blank grey screen... I've checked and the camera does work it just doesn't seem to be identifiable to Processing.
Any suggestions would be greatly appreciated.
I used this code:
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[0]);
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); }
Answers
Previous posts. Not sure if this has been solved.
Kf
https://forum.processing.org/two/discussion/14403/camera-video-image-slow
https://forum.processing.org/two/discussion/11060/surface-win8-1-and-video-library-doesn-t-work-why/p1
http://stackoverflow.com/questions/34322104/problems-accessing-web-camera-under-windows-10-opencv
Did you ever solve this? We're on a Surface 3 with Processing 3.3.2 and Video Library 1.0.1 and it hangs on the call to Capture.list() - it has always hung there.