Slow movie playback using PlayMovie

I’m using Psychtoolbox to play mp4’s, and am having trouble getting the movies to play at the correct speed. Some of the mp4's are about 4 s long per the duration returned by OpenMovie, but play for a variable length of time, up to 0.46 s over. The other mp4’s are 4.5 s, and play much more slowly than they should, for anywhere between 9 and 11 s. I’ve tried speeding up the playback by changing the rate in PlayMovie, but the speed doesn’t seem to increase (I've successfully decreased the speed of movies by changing the rate to 0.1, but haven't managed to increase the speed by entering 2 or 100; -1 also does not work to play the movies backwards). I’ve tried playing the movies two ways: using PlayMovie (per Psychtoolbox's SimpleMovieDemo) and pre-loading into textures (per LoadMovieIntoTexturesDemo), but the playback is slow using both methods. I’ve also tried running the function on multiple computers (a MacBook Air and two different MacBook Pro retinas). Any ideas on what might be causing this slowed playback? Thanks!
If you used the method from LoadMovieIntoTexturesDemo there's no way playback could be too slow, as you're just flipping preloaded images onto the screen, unless your movie doesn't fit into system memory/video memory, or maybe there's some kind of graphics driver bug?

So, does it happen with our own movie demos? What machine specs, what graphics card, what osx version etc.? Demo movie for download somewhere?
-mario
Hi Mario,
Thank you for your quick response. I tried a few more things, using your demo and videos. After some tuning, most of my original scenarios are now working. The one that still doesn't work is SimpleMovieDemo, with my own video  (418 frames, each of which is 696 x 490). The nominal play time is 4.18 s, but, even setting PlayMovie's rate parameter to 100, the fastest playback I can actually get is 4.98 s.

 So it looks like this maybe is a video memory issue? If so, is preloading into textures my only option? Would another OS/graphics setup be likely to work?

Here are my specs:

OSX: 10.9.2
Memory:  8 GB 1600 MHz DDR3
Graphics:  Intel HD Graphics 5000 1024 MB

Thanks again for your help.
Does PTB report missed frames when you get the longer than expected movie playback?

I'm not sure why you are using SimpleMovieDemo. In the help text to that demo it states:

% This bare-bones demo plays a single movie whose name has to be provided -

% including the full filesystem path to the movie - exactly once, then

% exits. This is the most minimalistic way of doing it. For a more complex

% demo see PlayMoviesDemo. The remaining demos show more advanced concepts

% like proper timing etc.


Read the last sentence. 


So, it sounds like this demo is not a good one to copy if you want good timing. For example, the demo doesn't specify a time to flip to the screen, so this might result in poor temporal properties.


There is a whole subfolder of movie demos, so SimpleMovieDemo is not your only option. 


OSX and onboard graphics are not ideal for precise timing. Linux + a reasonable graphics card is recommended for the best timing. 


However, that said, what you want to do doesn't sound too taxing to me. So I think it is probably down to your code. 


Try fixing you code to get the best timing possible (e.g. by specifying a time to flip to screen and setting the priority level appropriately) and then see if you are still encountering these issues. 


Peter


---In psychtoolbox@yahoogroups.com, <elightly57@...> wrote :

Hi Mario,

I tried a couple more things using your demos and videos, and most of these are working. The one that still isn’t working is SimpleMovieDemo (the exact code included with the distribution) with my own video (418 frames, each is 696 x 490).

The nominal playtime is 4.1800, but even with PlayMovie’s rate parameter set to 100, the fastest actual play time I can get is 4.9795.

Here are my specs:
OSX 10.9.2
Memory  8 GB 1600 MHz DDR3
Graphics  Intel HD Graphics 5000 1024 MB

Is preloading my only option? Also, should I expect better performance with a different OS and graphics setup?

Thanks for your help!


---In PSYCHTOOLBOX@yahoogroups.com, <mario.kleiner@...> wrote :

If you used the method from LoadMovieIntoTexturesDemo there's no way playback could be too slow, as you're just flipping preloaded images onto the screen, unless your movie doesn't fit into system memory/video memory, or maybe there's some kind of graphics driver bug?

So, does it happen with our own movie demos? What machine specs, what graphics card, what osx version etc.? Demo movie for download somewhere?
-mario