Simple movieStim results in many dropped frames

I have a few simple mp4 videos. The videos are each created from 120 .png images with ffmpeg at 60 fps, at a size of around 2.5mb.

I pre load a number of visual.videoStim3 which I then assign to an array.

video = visual.MovieStim3(WIN, 
            os.path.join(VIDEO_PATH, stimulus), 
            units='pixels', 
            size = (100,100),
            pos = [0,0], 
            loop = True, 
        )
stimuli.append(video)

Then, for a given trial I access the video and present it as such:

video = sitmuli[curTrial]
while video.status != constants.FINISHED:
    video.draw()
    WIN.flip()

This results in visually noticable dropped frames/laggy video. The following output is generated showing the dropped frames. What can be causing these laggy frames?

I have tried this code on two separate systems and it gives a similar result in both. What can I do to combat dropped frames? The systems are 8 and 16GB memory respectively with nothing else running concurrently.

20.5015         WARNING         0.6987386000109836: Video catchup needed, advancing self._nextFrameT from 0.016666666666666666 to 0.03333333333333333
20.5016         WARNING         0.6987661000457592: Video catchup needed, advancing self._nextFrameT from 0.03333333333333333 to 0.05
20.5016         WARNING         0.6987795000313781: Video catchup needed, advancing self._nextFrameT from 0.05 to 0.06666666666666667
20.5016         WARNING         0.6988079000147991: Video catchup needed, advancing self._nextFrameT from 0.06666666666666667 to 0.08333333333333333
20.5016         WARNING         0.6988189000403509: Video catchup needed, advancing self._nextFrameT from 0.08333333333333333 to 0.09999999999999999
20.5016         WARNING         0.698829900007695: Video catchup needed, advancing self._nextFrameT from 0.09999999999999999 to 0.11666666666666665
20.5016         WARNING         0.6988406000309624: Video catchup needed, advancing self._nextFrameT from 0.11666666666666665 to 0.13333333333333333
20.5017         WARNING         0.6988510999944992: Video catchup needed, advancing self._nextFrameT from 0.13333333333333333 to 0.15
20.5017         WARNING         0.698861200013198: Video catchup needed, advancing self._nextFrameT from 0.15 to 0.16666666666666666
20.5017         WARNING         0.6988711000303738: Video catchup needed, advancing self._nextFrameT from 0.16666666666666666 to 0.18333333333333332
20.5017         WARNING         Max reportNDroppedFrames reached, will not log any more dropped frames

Try using visual.VlcMovieStim, which seems to often work better.

Hi @mjpvz

Did you manage to sort out this issue? I’m getting exactly the same error message (on 2 different computers) whilst trying to present 2-3 second clips, all less than 1MB

Same problems here.

I am also having the same issue when I am trying to add a simple movie stimulus from the builder view. I am trying to add just 1 movie stimuli in and these are the errors I’m having:

Running: C:\Users\japneet\Bremen_experiment\final_trials2_lastrun.py

84620.0143 INFO Loaded monitor calibration from [‘2022_03_10 13:45’]
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
21.3109 WARNING 0.456220599997323: Video catchup needed, advancing self._nextFrameT from 0.0 to 0.04
21.3110 WARNING 0.4562805999885313: Video catchup needed, advancing self._nextFrameT from 0.04 to 0.08
21.3110 WARNING 0.45632099999056663: Video catchup needed, advancing self._nextFrameT from 0.08 to 0.12
21.3110 WARNING 0.45635689998744056: Video catchup needed, advancing self._nextFrameT from 0.12 to 0.16
21.3111 WARNING 0.4563912000012351: Video catchup needed, advancing self._nextFrameT from 0.16 to 0.2
21.3111 WARNING 0.4564249999966705: Video catchup needed, advancing self._nextFrameT from 0.2 to 0.24000000000000002
21.3111 WARNING 0.45645909999439027: Video catchup needed, advancing self._nextFrameT from 0.24000000000000002 to 0.28
21.3112 WARNING 0.45649319999211: Video catchup needed, advancing self._nextFrameT from 0.28 to 0.32
21.3112 WARNING 0.4565256999921985: Video catchup needed, advancing self._nextFrameT from 0.32 to 0.36
21.3112 WARNING 0.45655919999990147: Video catchup needed, advancing self._nextFrameT from 0.36 to 0.39999999999999997
21.3112 WARNING Max reportNDroppedFrames reached, will not log any more dropped frames
1.7247 WARNING Monitor specification not found. Creating a temporary one…
ioHub Server Process Completed With Code: 0