psychopy.org | Reference | Downloads | Github

Framerate of MovieStim

Hi everyone,

I was wondering if the MovieStim class reads the framerate from .avi files and thus displays the videos according to the fps given by the .avi files?

I am rendering the files in MotionBuilder in a uncommon framerate of 40 fps. This is due to dependencies of my experiment. It would be very important for my study that Psychopy displays the videos in this fps.

Thanks for any ideas on this! :slight_smile:

Generally speaking as long as the display you’re using has a refresh rate equal to or greater than that of the movie file, MovieStim and MovieStim3 should use the file’s built-in framerate. In terms of the actual images rendered to the screen PsychoPy will still default to the monitor’s refresh speed (so anything that loops on win.flip() will still go at 60Hz or whatever), but it’ll show the next frame of the movie according to the movie’s framerate, or at least that’s what it does for me. I have experiments that have movie files at 30fps, but the display running at 60Hz, and the movies play just fine.

That said, I’ve also been running into problems with higher framerates causing huge performance hits for no obvious reason other than there being more frames to render, so if you’re seeing slowdowns it might just be a performance issue.

1 Like

Thanks for the explanation! That helps me understand the background processes much better.

I didn’t have performance issues when playing the 40 fps videos so far. But I recently came across a precision issue that is in accord with your comment ‘PsychoPy will still default to the monitor’s refresh speed’. Namely having a monitor refresh rate that is a multiple of the video framerate might enhance the timing precision of the video display (see explanation at The Frame Rate / Refresh Rate Problem - YouTube starting at 2:26 sec). Accordingly, for a 120 Hz monitor with a 40 fps video, each frame flip of the video happens exactly at each third frame flip of the monitor. In case of 60 Hz with 40 fps the flip frequency of the video is not compatible with the flip frequency of the monitor.

That might not be PsychPy specific anymore and is probably a very fine-grained issue, but I wanted to mention it as a potential trouble-shooting aspects for similar cases.