I’m interested in experimenting a bit with feedback in Processing. Is Processing good for video feedback?
I haven’t seen any examples and it’s been tough to figure out how to approach it. I’m curious if I’m missing a resource that people here might know about.
Can you explain a little bit more, what you are trying to achieve?
There is a Video Library, and you can of course try pointing the recording camera at your screen to generate feedback.
If you like to record your own sketch and generate feedback from that, you could get the pixels and place them as new image on top. Experiment with the scaling, position and BlendMode to create more interesting effect. Here is an example for this:
// From https://processing.org/reference/libraries/video/Capture.html
import processing.video.*;
Capture cam;
void setup() {
size(480, 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() {
// Get the current display of the sketch
PImage c = get();
// Capture camera frame
if (cam.available() == true) {
cam.read();
}
// Display the camera frame
image(cam, 0, 0);
// Display a smaller previous frame
image(c, 20, 20, width - 40, height - 40);
}