Error/Bug when running video with audio in psychopy - 2026.2.4

OS (e.g. Win10): 11
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2026.2.4
Standard Standalone Installation? y
Do you want it to also run online? n
What are you trying to achieve?: Display a video with audio. The video is selected based on information reported in an excel. The video is 3.88 MB and is 2 minutes long.

What did you try to make it work?: Used builder and function to upload movie

Link to the most relevant existing thread you have found:

What specifically went wrong when you tried that?:
We received this error in which it seems it has troubles updating the frames.

self.updateVideoFrame():
line 1756, in updateVideoFrame
frameData = self._player.getFrame(self.movieTime)
line 1070, in getFrame
return self.getFrameFFPyPlayer(pts)
line 755, in _getFrameFFPyPlayer
raise RuntimeError(
RuntimeError: Failed to return a frame after multiple attempts.
######## Experiment ended with exit code 1 [pid:13868] #########

Variable frame rate is a common trigger for this. Phone/consumer recordings are often VFR, and FFPyPlayer’s getFrame(pts) loop can give up when the frame clock and the movie clock drift apart, especially with an audio stream present. Try re-encoding to constant frame rate first, e.g. ffmpeg -i in.mp4 -c:v libx264 -pix_fmt yuv420p -r 30 -c:a aac -movflags +faststart out.mp4, then rerun. If it still fails, a quick workaround is to strip the audio (-an) and play a separate Sound component so frame timing isn’t competing with audio sync.