ofVideoPlayer real slow and not using GPU video engine?

Hi,

I’m running several instances of ofVideoPlayer (each of them 500 MB) rendered on ofFBO instance and animate FBOs using serial from external sensors.

The video staggered and experienced horizontal ripples. I fired up Xcode’s OpenGL Driver Monitor and noticed that GPU Core Utilization were used heavily, climbing to 300,000,000 many times but GPU Memory Utilization, GPU Video Engine Utilization and OpenGL Data Buffer stayed unused at 0.

I’m hoping that by pushing some tasks to the video engine I can boost the performance of my video, but I don’t really know how that would help and how to achieve that. Will this help, and on what condition will the GPU use the video engine?

I have to know I’ve done everything I can before deciding that my macbook air is way too old for this task and I’ll need to get a pro.

I’m on Macbook Air (2010) OSX (Lion) 10.7.5, 1.4 GHz Intel Core 2 Duo
2 GB 1067 Mhz DDR3 Memory
NVIDIA GeForce 320M 256 MB GPU
I’m using OF version 7.3 within Xcode 4.6.3

Here is my code:

  
  
void setup() {  
    fbo1.allocate(ofGetWidth(), ofGetHeight(), GL_RGB);  
    fbo2.allocate(ofGetWidth(), ofGetHeight(), GL_RGB);  
    fbo3.allocate(ofGetWidth(), ofGetHeight(), GL_RGB);  
      
    pos.set(0, 0);  
  
    ofSetFrameRate(60);  
    ofBackground(255,255,255);  
  
    m1.loadMovie("movies/home.mov");  
    m2.loadMovie("movies/walkthrough.mp4");  
    m3.loadMovie("movies/africa.mp4");  
      
    m1.play();  
}  
  
void update() {  
   m1.update();  
   m2.update();  
   m3.update();  
}  
  
void draw() {  
    fbo1.begin();  
    m1.draw(0, 0, fbo1.getWidth(), fbo1.getHeight());  
    fbo1.end();  
          
    fbo2.begin();  
    m2.draw(0, 0, fbo2.getWidth(), fbo2.getHeight());  
    fbo2.end();  
      
    fbo3.begin();  
    m3.draw(0, 0, fbo2.getWidth(), fbo2.getHeight());  
    fbo3.end();  
  
    fbo1.draw(pos.x, pos.y);  
    fbo2.draw(pos.x-ofGetWidth(), pos.y);  
    fbo3.draw(pos.x+ofGetWidth(), pos.y);  
  
  
    if(myByte == 65){  
          
        // Go to video 2  
        pos.x = pos.x + (targetX - pos.x) * easing;  // ease to targetX  
          
        float vUp = pos.x/700;  
        float vDown = 1 / vUp * 0.2;  
          
        m2.play(); // Play m2  
        m2.setVolume(0);  
        m1.setVolume(vDown);  
  
        if(pos.x > targetX - 10){  
              
            m1.setPaused(true); // Pause m1  
                          
        }  
  
    }  
    else if(myByte == 66){  
          
        pos.x = pos.x - (baseX + pos.x) * easing;          
          
        float vDown = pos.x/700;  
        float vUp = 1 / vDown * 0.2;  
          
        m1.play();  
        m1.setVolume(vUp);  
        m2.setVolume(0);  
          
        if (pos.x < 10){  
              
            m2.setPaused(true);  
  
        }  
    }  
      
    else if(myByte == 67){  
        pos.x = pos.x - (ofGetWidth() + pos.x) * easing;  
          
        float vDown = pos.x/700;  
        float vUp = 1 / vDown * 0.02;  
          
        m3.play();  
        m3.setVolume(vUp);  
          
    }  
}  
  

I’m attaching the monitor screen too.

[shadow=red,left][/shadow]

![](http://forum.openframeworks.cc/uploads/default/3018/Screen Shot 2013-09-17 at 9.59.19 PM.png)

You’re right, we’re not leveraging all the built in OSX video functionality, however, there are some addons that are. Check this out https://github.com/obviousjim/ofxAVFVideoPlayer

Joshua, thank you for your help. I have diverted to working in C# with Visual Studio’s Expression Blend and it played the same big videos super smoothly. I guess it used “player” instead of drawing video pixels repeatedly on the screen. Is there anyway I can implement that in OF, or should I get rid of the excessive pixels it collectively draws on top with C++ malloc?