psychopy.org | Reference | Downloads | Github

MovieStim 2 issues

Hi,

I’m trying to make it so that participants watch a video clip before taking part in an experimental task involving pressing a button if they want to take one action and pressing another if they don’t. The experiment will play the first video clip and then show the first trial of the task before crashing.

I get given the following error:

C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\visual\movie2.py:352: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
dtype=numpy.uint8)
Traceback (most recent call last):
File “C:\Users\Josh\Documents\University\Year 4\Creating Psychological Experiments\Experiment\Flint\FixingBlockSelect_Test ARGH.py”, line 779, in
movie.setAutoDraw(True)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\visual\movie2.py”, line 802, in setAutoDraw
self.play(log=False) # set to play in case stopped
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\visual\movie2.py”, line 431, in play
self._video_track_clock.reset(-nt)
TypeError: bad operand type for unary -: ‘NoneType’
()

I’ve tried using different video file formats and renaming the files. I’ve even tried taking all the videos into one script and seeing if they’ll play, but then I get the same problem where it will play one video and then I get this:

C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\visual\movie2.py:352: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
dtype=numpy.uint8)
[1b981e64] core input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 300 ms)
[1b981e64] core input error: ES_OUT_RESET_PCR called
Traceback (most recent call last):
File “C:\Users\Josh\Documents\University\Year 4\Creating Psychological Experiments\Experiment\Flint\MultiVid test.py”, line 78, in
mov.draw()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\visual\movie2.py”, line 716, in draw
self._updateFrameTexture()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\visual\movie2.py”, line 679, in _updateFrameTexture
raise RuntimeError(“Could not load video frame data.”)
RuntimeError: Could not load video frame data.

Is there a way to fix it so that the video files will play and the experimental task won’t crash? I’ve added a copy of the script below. I’m using a Windows-10 64-bit system and the latest version of PsychoPy.

Thanks,

Josh

FixingBlockSelect_Test 2.0.py (55.9 KB)

Could you try using MovieStim3 instead?

Hi Jon,

I’ve tried movieStim, movieStim2 and movieStim3 but I’m getting the same error still. Do you have any other suggestions or understanding of what the error code means?

Thanks,

Josh

If they all show the same error then it sounds like the video format is not working then. When you say you tried diff formats how did you convert?

Hi Jon,

I converted using a video conversion programme. I’ve tried mp4, avi and mov but the error message doesn’t change.

Thanks,

Josh

I just looked at your code and you’re trying to load the video from the disk on every frame (ie every time the screen updates you start loading the video again from scratch!). Load your movie at the beginning of the trial or beginning of the experiment.

Any reason you’re not just doing this in Builder (which wouldn’t make that mistake)?

Hi Jon,

I am designing this in Builder. Assume I know next to nothing, could you tell me how to fix this please? It’s meant to be that the video plays then the trial begins, and that’s the way I designed it in builder mode (I think).

Thanks,

Josh

Ah, because you sent a .py file I assumed you were writing this in code. If you’re doing it in Builder then you’d be better to send us the Builder experiment file (the one ending psyexp that you open in builder).

Hi Jon,

Try this - I’ve isolated just the video component and randomisation loop. I’ve also added the spreadsheets needed.

Thanks,

Josh

P.S. I don’t suppose you have any idea of how to record if a mouse click is the correct response in an output excel file? i.e. if the participant correctly clicks left on the mouse when they are meant to.

VideoStim.psyexp (54.5 KB)
BlockSelect.xlsx (8.0 KB)
Real_TrialsMC.xlsx (8.9 KB)

Did you upload the wrong file. VideoStim.psyexp contains no mention of a movie

Hi Jon,

Sorry for the delay. My internet router was one the ones that was taken down in the TalkTalk hacking so Ive only just been able to respond. I’ve attached an updated copy of the file (no idea where the videos went).

Thanks,

Josh

VideoStim.psyexp (58.2 KB)

I don’t know if this is related to your problem but I think you may have mixed up the resolution with position within every video component.

Hi Yiannis,

I didn’t realise that was the case. On my screen the resolution is in the size box, not the position box. Could you perhaps send a screenshot of what it looks like on your end please?

Thanks,

Josh

sure…i opened it in a windows 10 tablet, psychopy 1.84.2

Hi Yiannis,

Ah that’s strange. I don’t suppose the movies run for you without crashing? (After my error has been adjusted for of course)

Thanks,

Josh

Hi Josh,

I opened your file in my work networked PC (Win7) and it still shows resolution and position misplaced.

I also think you need to change the Movie file from constant to set every repeat (I may be wrong about that though).

I run your exp by adjusting resolution, removing the images and their associated code and using the wildlife.wmv video file found in windows movie folder and it ran just fine for me.

Attached.
VideoStim (1).psyexp (51.8 KB)

Hi Yiannis,

When I play the experiment, it repeats the first video clip over and over again. Is there a fix for this so that it goes:

  1. Video clip
  2. Response task (i.e. clicking left or right on the mouse when presented with pictures)
  3. Move onto next video clip

I’m also unsure my randomiser ‘BlockSelect’ works as it always seems to start with the Block1. Is there any chance you can help me out here please?

Thanks,

Josh

Hi Josh,

I am afraid I do not have handy three videos to test it.

However, I think this very nice answer from @jderrfuss may help you (also look further down for an update by the same author)