Error loading video using MovieStim3

If this template helps then use it. If not then just delete and start from scratch.
2OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2021.1.2
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: Running an experiment where the trials show a video

What did you try to make it work?: It works fine on my mac, but when I run it on windows (which I need to do due to incompatibility with the microphone component and mac) I get an error message before the video plays.

WARNING User requested fullscreen with size [1440 900], but screen is actually [1920, 1080]. Using actual size
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py”, line 189, in loadMovie
sampleRate=self._mov.audio.fps)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 318, in init
hamming=self.hamming)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 373, in setSound
raise err
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 365, in setSound
blockSize=self.blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 96, in getStream
blockSize=blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 135, in _getStream
.format(label, list(self.keys())[0], sys.platform)
psychopy.exceptions.SoundFormatError: Tried to create audio stream 44100_2_128 but 48000_2_128 already exists and win32 doesn’t support multiple portaudio streams

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\aless\Desktop\TaskB\TaskB_lastrun.py”, line 311, in
depth=0.0,
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\contrib\lazy_import.py”, line 120, in call
return obj(*args, **kwargs)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py”, line 140, in init
self.loadMovie(self.filename)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py”, line 198, in loadMovie
sampleRate=self._mov.audio.fps)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 318, in init
hamming=self.hamming)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 373, in setSound
raise err
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 365, in setSound
blockSize=self.blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 96, in getStream
blockSize=blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 135, in _getStream
.format(label, list(self.keys())[0], sys.platform)
psychopy.exceptions.SoundFormatError: Tried to create audio stream 44100_2_128 but 48000_2_128 already exists and win32 doesn’t support multiple portaudio streams
Exception ignored in: <bound method MovieStim3.del of <psychopy.visual.movie3.MovieStim3 object at 0x0000016242623DA0>>
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py”, line 499, in del
self._unload()
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py”, line 476, in _unload
self.clearTextures()
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\basevisual.py”, line 1141, in clearTextures
GL.glDeleteTextures(1, self._texID)
OSError: exception: access violation reading 0x0000000000000000

The video has no sound, but comes after an audio clip (which plays fine)

Thanks!

Everything with audio needs to have the same sampling rate. I’ve sometimes opened audio files in audacity to resample

@wakecarter okay that’s what I thought but since my movie has no sound to it I’m wondering if this error is from my sound stimulus that plays before the movie ? Which has been running fine, the crash happens after.

It doesn’t matter which sample rate you use but both files need to be the same, even if the second one technically doesn’t have any sound.

Hi @wakecarter thank you for your help, I checked and my mp4 file and audio file are both the same sampling rate so I’m not sure what else I can do to make this work. I will mess around more with it today and hopefully can fix it. Thanks again

Have you tried setting the “noAudio” flag of MovieStim3 to True?

Hi @KylieIsenburg , I was wondering whether you got this to work in your experiment? I too had issues getting my videos to play when having an audio component in a previous routine, even though they were encoded with the same sampling rate. I ended up redesigning my experiment without the audio component because then my videos seemed to work!

Hi @milsandhills - I worked on this as a grad school rotation project so forgive me if I’m a bit shaky on the details as it was a while ago now. I believe I had to strip audio from the videos to work, and in the end I think it might have had to do with the fact that the hardware I was using was old. I didn’t need the audio component so it was okay for me to remove it. Sorry I can’t be more helpful for you :confused:

1 Like