Skip to content

Instantly share code, notes, and snippets.

@companje
Created November 23, 2019 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/f6e70f179680318525332db68c9ab51c to your computer and use it in GitHub Desktop.
Save companje/f6e70f179680318525332db68c9ab51c to your computer and use it in GitHub Desktop.
Two cams / cameras
import processing.video.*;
Capture cam1, cam2;
void setup() {
size(1280, 480);
//printArray(Capture.list());
cam1 = new Capture(this, "name=HD Pro Webcam C920,size=640x480,fps=30");
//cam2 = new Capture(this, "name=BRIO 4K Stream Edition,size=640x480,fps=30");
cam2 = new Capture(this, "name=Logitech Webcam C930e,size=640x480,fps=30");
cam1.start();
cam2.start();
}
void draw() {
if (cam1.available()) cam1.read();
if (cam2.available()) cam2.read();
image(cam1, 0, 0, 640,480);
image(cam2, 640, 0, 640,480);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment