buffered video playback
in
Programming Questions
•
1 year ago
Hi,
Can anybody suggest a way of playing back a MOV file (640*480 using animation lossless codec) at 60fps, and being able to jump to any frame number.
I have a requirment to play the video at exactly 60 fps, and every so often sync the video with an external signal whcih is coming in via a serial connection.
Currently, I can only seem to get about 35 fps or so using P2D which seems to be the fastest mode. If I import a series of TIF images, i can easily get more than 60 fps, so is it being throttled by the buffering speed of the video being loaded?
heres the code. Thanks!
int x=0;
int y=0;
import processing.video.*;
Movie myMovie;
void setup() {
size(640,480,P2D);
frameRate(60);
myMovie = new Movie(this, "skulls.mov");
myMovie.loop();
}
void draw() {
background(0,0,0);
// delay(1);
if(myMovie.available()) {
myMovie.read();
println(frameRate);
println(x);
println(y);
image(myMovie,x,y);
}
}
Can anybody suggest a way of playing back a MOV file (640*480 using animation lossless codec) at 60fps, and being able to jump to any frame number.
I have a requirment to play the video at exactly 60 fps, and every so often sync the video with an external signal whcih is coming in via a serial connection.
Currently, I can only seem to get about 35 fps or so using P2D which seems to be the fastest mode. If I import a series of TIF images, i can easily get more than 60 fps, so is it being throttled by the buffering speed of the video being loaded?
heres the code. Thanks!
int x=0;
int y=0;
import processing.video.*;
Movie myMovie;
void setup() {
size(640,480,P2D);
frameRate(60);
myMovie = new Movie(this, "skulls.mov");
myMovie.loop();
}
void draw() {
background(0,0,0);
// delay(1);
if(myMovie.available()) {
myMovie.read();
println(frameRate);
println(x);
println(y);
image(myMovie,x,y);
}
}
1