Hi
I have a .MOV video file that is 640 x 480 px @ 24.99 FPS, no audio.
I want to trigger play when an object comes 10 cm or less to the Ping))) Ultrasonic Sensor.
Processing is getting the serial data with no problems.
The video plays when anything is at 10 cm or less from the sensor.
The thing is that the video plays at a very low frame rate.
I've tried several codecs and all of them play bad.
Processing is using 2048 MB of maximum available memory.
Thanks in advanced.
Code:import processing.serial.*;
Serial myPort;
int val;
import processing.video.*;
Movie myMovie;
void setup() {
String portName = Serial.list()[1];
myPort = new Serial(this, portName, 115200);
size(640, 480);
myMovie = new Movie(this, "640x480_5.mov");
myMovie.loop();
}
void draw() {
if (myPort.available() > 0) {
val = myPort.read();
image(myMovie, 0, 0);
if (val == 0) {
myMovie.pause();
println(val);
}
else {
myMovie.play();
println(val);
}
}
}