Psychopy alternatives, Psychopy timing issues

What python software do you recommend for displaying videos in an MRI scanner?


I tried using PsychoPy to display short video clips in an MRI scanner, but the videos were delayed despite the code being set to wait for the scanner’s trigger. What’s even weirder was that the delay was varying across different subjects.

Switching to simpler code, I added a sound at the beginning and end of each video. However, part of the sound plays before the video starts.

Does anyone know what might be causing these issues?

I attach a link for both codes
https://drive.google.com/drive/folders/1tzx3cWJ9rFB2E86pLMWE8wQBq9AtKYor?usp=sharing

i’m not a PsychoPy expert but I got non-delayed video to play once with a static “preload” period. if you use Builder it’s a drop-in module under the “Custom” components. there’s also a vibrant and responsive discourse forum over on their website.

1 Like

+1 to @stbmtx’s comment. I had a similar issue with video delays (Gray screen before video with VlcMovieStim - Coding - PsychoPy) and got a solid response in a couple of days.

EDIT: I am not familiar with other stimulus-presentation tools in Python. I do know folks are using FIRMM for film-viewing stimuli at UMinn, but I don’t have any details on that.

1 Like

I will look it up, thanks!

That sounds similar to my situation, thank you! :smile:

Hi everyone,

just wanted to add our experience regarding this in case folks find it helpful.

For an experiment, we played videos (continuously) and music (new song every 7-10 seconds) at the same time, in runs of 10 mins, 6 runs in the entire experiment, back to back, with a short pause between runs (1-2 mins).

In the beginning, we also had major problems with delays but then adapted the code to pre-load the entire video and all music. Similar to what @stbmtx outlined.
As far as I can tell/know, the delays can arise due to a buffer/loading/working memory problem, ie the machine used to run the experiment cannot load and play the videos “fast enough”. Via pre-loading everything, it was ready to go when needed. The downside is that it creates quite some stress for the working memory which might cause other problems and could result in long pre-loading periods at the beginning of your experiment. Thus, you would ideally adapt things also based on the computational resources available to you.

HTH, Cheers, Peer

2 Likes