playing movie very fast

Hi,

I want to change the speed of a playing movie (filmed with a highspeed camera) on the fly from 1 to very high values like 100 or maybe even 500.

When I do this the framerate of my application drops dramatically. May be this has to do with the amount of keyframes / groups of pictures in the movie file. I will try to use ffmpeg to create more keyframes.

In the meantime, has anyone experience with playing movies very fast?

Rick

I converted my movie using ffmpeg to a situagion where every frame is a keyframe. The movie is now 22GB. It really helps a lot. But when changing the speed (by setSpeed) it is still having a hard time.

I would try to

-render video as every frame a keyframe
-keep video paused
-instead of playing fast, calculate in every update which frame to draw and jump to it

that way you get the max possible framerate w/o choking your system too much with a fps that is impossible

Thanks robotfunk, that does the trick. I can play at any speed now. No problems at whatever value (even speed=10000 works perfectly).

  
  
void testApp::update(){  
  
    pos += (speed/fps) / movie.getDuration();  
  
    pos = fmodf(pos,1);  
    if (pos<0) pos++;  
  
    movie.setPosition(pos);  
    movie.idleMovie();  
}