Open lmagoncalo opened 2 years ago
Not sure if it's related, but I could only get the camera to work (using P3D mode) when displaying the video image one, ie image(cam, 0, 0);
.. I only wanted the pixel brightness, so it worked to place it once within the setup... but made me check issues as to why this was needed and might be connected to your issue?
This issue also occurs with Windows 11 Pro. And cam.copy() has the same problem. I also used the Video library TimeDisplacement example, changing to size(640, 480, P2D) to verify the issue exists.
Also this code shows video but the camera image cannot be modified:
import processing.video.*;
Capture cam; PImage img;
void setup() { size(640, 480, P2D); // Change to JAVA2D to work
String[] cameras = Capture.list();
cam = new Capture(this, cameras[1]);
cam.start();
}
void draw() { if (cam.available() == true) { cam.read(); img = cam; //img = cam.get(); } image(img, 0, 0); }
When using the function get() in a video capture, the returned PImage is all black when using the P2D/P3D/OPENGL renderer. However, if I switch the renderer to JAVA2D it works fine.
Code to reproduce:
I am using the macOS Monterey but it also happens using a Windows 10.