A buffer in the beginning of a video

OS (e.g. Win10): win11
PsychoPy version (e.g. 2024.2.4 Py 3.8): v2025.2.3
Standard Standalone Installation? Y
Do you want it to also run online? N
What are you trying to achieve?: I have 8 videos in a random order, and every time a video loads up in a trial, there’s a buffer, a black square, that pops on the screen for a short time but it does bother while running the task, is there any way to solve it?

What did you try to make it work?: I tried to load the video during the “static” period that I put with the static component, but it doesn’t work

Is your background set to white in Experiment Settings or do you have a white polygon in each routine to make the background white?

My background for the whole task is set to white

1 Like

What does the routine look like?

How large are the video files?


Each video file is about 250kb, the cueImg and the moviestim are both drawn from a xlsx file with condition, but I also have two example trials where I put the video and image directly and it still looks the same. All of them start as a text (fixation point), the cue image, then a static image that stays the same and then 1 of 8 different videos. All the videos last for 5 second, but the participant should be able to choose to skip at any point, as soon as the video starts

Does anyone know what to do?

Hi. Sorry – here are a couple of thoughts (that I haven’t tested).

  1. Move moveStim above image_2

  2. Either set image_2 to end after 1.05 seconds or give it a conditional end of movieStim.status == STARTED

I tried both and unfortunately it’s the same

I’ll add that I tried changing the player type to moviepy,vlc and opencv, I also tried using loading during static, and tried to use different random videos, tried to disable all components except the text in the beginning (which is just a cue) or even disabaling everything but the video- it’s all the same

update- I downloaded an older version (2025.1.1) and everything works great, no buffer

We made some changes to how movies are buffered and rendered in 2025.2.0 ( Release PsychoPy 2025.2.0 · psychopy/psychopy · GitHub ) so I think this is a result of those. The key difference is that movie frames are now buffered asynchronously, which allows for easier seeking to timestamps and is generally better for stability and speed, but it looks like there’s sometimes a frame at the beginning which is allocated for before any data has arrived (so displays as black), hence what you’re seeing.

This is fixable I believe, and @mdc is already looking into it. I’ll report back here when we have a fix for this :slight_smile:

1 Like

I think the easiest way to resolve this is to ensure the first frame has its data transferred to the image buffer before playback starts. So at the very least something is visible instead of presenting the zeroed-out texture storage

I put in a fix here to make MovieStim show the first frame when stopped instead of a black square (empty buffer)

I’m having a very similar problem. There is a glitch at the start of every video. Also, when the videos load the sound plays outload. I tried changing to Psychopy version 2025.1.1, but it didn’t resolve these issues for me. Any other tips?