FFPyPlayer (seemingly) randomly failing to load video

Hi!

When I try to load videos (.mp4 files at 720p HEVC with AAC audio) using visual.MovieStim, sometimes the loading fails and I get the following error message:

FFPyPlayer failed to extract metadata from the movie. Check the movie file and decoder options.

Whenever I try to use a differen decoder (moviepy or pygame) I get this error:

MovieAudioError: Movie audio playback is only supported with the ‘sdl2’ library at this time.

It doesn’t seem to be an issue with my files because the same file can sometimes load or sometimes fail.

I’m using the following line to create the stimulus:

movie = visual.MovieStim(win, video_file, size=tuple(win.size), noAudio=True)

Any help or tips are appreciated!

2 things to check ( just spitballing here)

  1. is it possible the file is already open and locked by some other process?

  2. if you run mplayer or mpv on the file, are there warnings or codec errors?

  3. are you creating and trying to display the same movie within your experiment?

  4. how big is the created movie file?

All sorted out, it was the video codec + audio track that was giving me issues. Reencoding to H264 and removing audio from the files did the trick. Still thank you!