Hi, I have to reflect and mirror the half of the left video with the right one. I tried this code but when I activate the effect the video shows only the first frame and does not play. How can I play the video with the effect? thanks!
import processing.video.*;
boolean flipVideo = false;
Movie movie;
PGraphics flippedBuffer; // PGraphics buffer for the flipped video
PImage leftHalf;
void setup() {
size(640, 480);
frameRate(30);
movie = new Movie(this, "movie.mov");
movie.loop();
movie.read();
flippedBuffer = createGraphics(movie.width, movie.height); // Initialize the buffer
}
void draw() {
if (movie.available() && overlay.available()) {
movie.read();
}
movie.loadPixels();
// Create the flipped video and store it in the PGraphics buffer
if (flipVideo) {
flippedBuffer.beginDraw();
leftHalf = get(0, 0, width/2, height);
flippedBuffer.translate(width, 0);
flippedBuffer.scale(-1, 1);
flippedBuffer.image(leftHalf, 0, 0);
flippedBuffer.endDraw();
} else {
flippedBuffer.beginDraw();
flippedBuffer.image(movie, 0, 0); // Use the original video
flippedBuffer.endDraw();
}
}
void movieEvent(Movie m) {
m.read();
}
void addTuioObject(TuioObject tobj) {
...
}
void removeTuioObject(TuioObject tobj) {
...
}