We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone, i have used the Loop example of Video librarie of Processing. The idea is basic, i want to move the mouse around X or Y axis and switch between two or more videos which start at the same time. The two videos are in a loop.
The problem that i have is when i switch from video 1 to video 2 or vice versa. The first frame correspond to the last frame that i saw from the video. Seems like keep in buffer the last frame. ¿How can i delete it to make the switch more "clean"?
The code is: (Transit.mov and transit2.mov are the same video from examples, just to see if the switch is clean)
import processing.video.*;
boolean boton1 = false;
boolean boton2 = false;
Movie movie1;
Movie movie2;
void setup() {
size(640, 480,P3D);
frameRate(30);
movie1 = new Movie(this, "transit.mov");
movie2 = new Movie(this, "transit2.mov");
movie1.loop();
movie2.loop();
}
void movieEvent(Movie m) {
if (m == movie1) {
movie1.read();
} else if (m == movie2) {
movie2.read();
}
}
void draw() {
if (boton1 == true) {
image(movie1, 0, 0, width, height);
}
else if (boton2 == true) {
image(movie2, 0, 0, width, height);
} else {
noFill();
}
if (mouseX > 0 && mouseX < 320 && mouseY > 0 && mouseY < 640) {
boton1= true;
boton2= false;
}
else if (mouseX > 320 && mouseX < 640 && mouseY > 0 && mouseY <640) {
boton1= false;
boton2= true;
}
else{
boton1= false;
boton2= false;
}
}
Answers
Any help?
Try changing the movie event method to
This will read both movies even if only one is being displayed.
It doesn't work.
Anyone??????
I just want to remove the "first" frame when i switch the video....
I've just tried your code and it works perfectly (on 3.02 64-bit Windows)
Hi Vicdoval. When you switch between two videos there is no a disscordance in the first frame? Do you switch clean one to another????
Could you upload a video?
Here it is: https://dl.dropboxusercontent.com/u/48894188/temporal/videoSwitchc.mov
If u could switch the same video we'll see the error that i mean....
I do the switch too, but if i switch the same video, is a frame that does not correspond... first one.
There are lotta examples under tag movieEvent() if you care to look at: #:-S
https://forum.Processing.org/two/discussions/tagged?Tag=movieevent()