hey thanks ! the examples helped me understand the problem - I see several issues with the smaller example. the big example didn’t unzip properly so I have to try downloading it again…
this is based on OF 0.04 code - can you try it out under the 0.04 version? (openframeworks.cc/download) it would be very helpful -
testApp.h / testApp.cpp
class testApp : public ofSimpleApp{
public:
testApp();
void setup();
void update();
void draw();
void keyPressed (int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased();
ofVideoPlayer fingerMovie[10];
};
#include "testApp.h"
#include "stdio.h"
//--------------------------------------------------------------
testApp::testApp(){
}
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(255,255,255);
for (int i = 0; i < 10; i++){
fingerMovie[i].setUseTexture(true);
fingerMovie[i].loadMovie("movies/fingers.mov");
fingerMovie[i].play();
}
}
//--------------------------------------------------------------
void testApp::update(){
MoviesTask(0,0); // idle all the movies, instead of one as a time.
// seems to be a lot faster with multiple movies
}
//--------------------------------------------------------------
void testApp::draw(){
printf("frameRate %f \n", ofGetFrameRate());
ofSetColor(0xFFFFFF);
for (int i = 0; i < 10; i++){
fingerMovie[i].draw(i*30,20);
}
}
//--------------------------------------------------------------
void testApp::keyPressed (int key){
}
//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::mouseReleased(){
}
I think that there are several things that can be optimized but I’d like to know if this helps at all, I get about 25 fps playing 10 x 320x240.
there are some big costs associated with playing multiple movies, and I think we are for the most part maxing out quicktime, not OF - so this is a quicktime fix, which calls the moviesTask once per idle frame on all movies as opposed to once per movie/frame, which seemed to be alot more taxing.
then there are some optimizations in terms of pixels and drawing that will help too - but this seemed to help at least on the pc side get 10 movies playing smoothly.
as an alternative, you might consider loading the movies into ram, ie calculating number of frames you would like, grabbing the frames into ram (or even textures, since graphics card space is cheap) and playing the movie that way. it will definitely be much, much faster because it will not be dependent on quicktime to decompress, read from disk, every frame.
zach