In short, I’ve built a script for running studies with babies that plays an attention getter followed by a movie file. The attention getter consists of a looming geometric shape and, at the same time, plays a short .wav sound file which is loaded at the start of the script. Immediately after the attention getter, the script displays the first frame of the movie, paused. The movies are all .movs with mpeg-4 encoding and 48000Hz mono audio.
I built in the capability to re-play the attention-getter if the infant does not immediately look at the screen, with the first frame of the movie frozen on the screen. So, the movie disappears, the attention getter plays again, first frame reappears paused. All fine.
The issue is, if the movie has sound, sometimes (and only sometimes, which is maddening) after re-playing the attention-getter several times, when I start trying to play the movie, I get the following error (picking up from the draw command in my script):
dispMovie.draw() File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/movie3.py", line 383, in draw self._updateFrameTexture() # will check if it's needed File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/movie3.py", line 303, in _updateFrameTexture self._numpyFrame = self._mov.get_frame(self._nextFrameT) File "<decorator-gen-14>", line 2, in get_frame File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/moviepy/decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/moviepy/video/io/VideoFileClip.py", line 74, in <lambda> self.make_frame = lambda t: reader.get_frame(t) File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/moviepy/video/io/ffmpeg_reader.py", line 163, in get_frame result = self.read_frame() File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/moviepy/video/io/ffmpeg_reader.py", line 106, in read_frame s = self.proc.stdout.read(nbytes) AttributeError: FFMPEG_VideoReader instance has no attribute 'proc'
My best guess is some kind of conflict caused by the sound.play() of the attention-getter using the same FFMPEG resources as the movie’s sound.play (because moviestim uses psychopy.sound for its sound), so in theory this could happen if you were alternating sound files as well.
Has anyone else encountered this, or have any ideas about how to stop it from happening?