FFPyPlayer intermittently crashing when trying to load video metadata

50 Shades.zip (31.3 KB)

Videos can be downloaded from here

Hi!

I’ve been having a lot of difficulty troubleshooting the following error for the past week. This error occurs in the “other_1” routine in the attached experiment:

raise RuntimeError(
RuntimeError: FFPyPlayer failed to extract metadata from the movie. Check the movie file and decoder options.

OS: Windows 10 21H2
PsychoPy version: 2025.2.4
Standard Standalone Installation? (y/n): Yes
Do you want it to also run online? (y/n): No
What are you trying to achieve?:

Running an experiment where participants are presented with a random video. Occasionally when loading a video, the experiment crashes (Maybe 5% of the time). It seems to be a different video each time.

What did you try to make it work?:

Reencoding the videos to H.264/AAC, crashes still occur.

Creating an experiment with only the specific routine causing the crashes (This doesn’t seem to cause the crash by itself)

Using different computers, it still crashes. I am planning to test of a PC with better hardware later today.

Closing all other non-essential processes running in the background

Restarting the PC

Reinstalling Psychopy

Using other movie backends, these all had errors as well (but different)

Looking into the source code (psychopy/visual/movie/_init_), there is a 5 second timeout for loading the video metadata. From looking in the experiment logs s

ome videos take up to 3 seconds to load the metadata. All videos are under 120MB in size, the crash doesn’t seem to correlate with file size.

Link to the most relevant existing thread you have found:

FFPyPlayer (seemingly) randomly failing to load video - Coding - PsychoPy

What specifically went wrong when you tried that?:
The same error as before:

raise RuntimeError(
RuntimeError: FFPyPlayer failed to extract metadata from the movie. Check the movie file and decoder options.

We are experiencing the same error:
“RuntimeError: FFPyPlayer failed to extract metadata from the movie. Check the movie file and decoder options.”

The error occurs with multiple video files and at different moments, so it doesn’t seem tied to a specific file. So far, we haven’t found a solution.

We’ve tested this on several computers (all with 16 GB RAM, which should be sufficient), but interestingly, the error does not occur on one of them.

Additionally, when we check the video files afterward, the file that triggered the error cannot be renamed, showing a “file is in use in Python” message, while other video files can be renamed without any issues.

Has anyone experienced something similar or found a fix?