I have a sequence of 2 mp4 videos played 4 times (4 trials), with a fixation cross that appears before each animation as shown in the code below.
In order to load, play and draw the animations, I used
MovieStim3 following [this demo] made by @richard. I used the functions
.draw to play and draw the movies.
The movies are played, however, at the beginning of the 3rd and 4th trial, the animation freezes for 3seconds before moving. This is really problematic because it is influencing badly the effect of the animation on my participants’ perception. Any advice would be very helpful. Thanks in advance
# Load optic flow and random flow movies optic_flow_movie = visual.MovieStim3(win, 'optic_flow.mp4',loop= False) random_flow_movie = visual.MovieStim3(win, 'random_flow.mp4',loop= False) for trialcount in range(nTrials): # We start the timer for each trial kb.clock.reset() # Start with fixation cross fixation.draw() win.flip() core.wait(2) # Play the video for 200 frames optic_flow_movie.seek(0) random_flow_movie.seek(0) for Nframes in range(200): if conditions_rand[trialcount] == 1: optic_flow_movie.play() optic_flow_movie.draw() elif conditions_rand[trialcount] == 2: random_flow_movie.play() random_flow_movie.draw() fixation.draw() win.flip()