I’m trying to show looped videos with MovieStim3, and I have noticed that the video lags when it loops.
It probably has something to do with
seek(0) at the begining of the loop - ffmpeg is slow at seeking particular frames. Is there a workaround?
Below is the code example and frame intervals plot with highlighted lags.
psychopy 2020.1.2, pyglet 1.5
Win10x64, nvidia gtx1050. Python runs on Nvidia graphics card, Vsync on
import sys from psychopy import visual, core, event, data, gui,logging, prefs from matplotlib import pyplot as plt win = visual.Window(fullscr=True, rgb='black', size=[1920,1080], winType='pyglet') win.recordFrameIntervals = True video = visual.MovieStim3(win, filename=r"./video.mp4", loop=True, noAudio=True) while 1: if 'escape' in event.getKeys(): win.close() plt.plot(win.frameIntervals, 'o') plt.show() sys.exit() video.draw() # draw other irrelevant stuff win.flip()