Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] MovieStim and Psycho backend problem

edited March 2013 in OpenSesame

I have to display a video file in an experiment builded in Psycho. Since the media_player_vlc plug-in does not work on Psycho, I'm trying to display the movie by the PsychoPy commands. However, something goes wrong. This simple code:

from psychopy import visual

mov = visual.MovieStim(exp.window, 'C:/Users/Andrea/Desktop/Movie.avi')
mov.draw()
exp.window.flip()

produces the following error:

In: inline_script (prepare phase)
File "dist\psychopy\visual.py", line 3816, in __init__

Python traceback:
AttributeError: 'NoneType' object has no attribute 'width'

and in the debug window:

File "dist\libopensesame\inline_script.py", line 111, in prepare
File "<string>", line 3, in <module>
File "dist\psychopy\visual.py", line 3816, in __init__
AttributeError: 'NoneType' object has no attribute 'width'

I use a PC with Windows 7 64 bit. From the PsychoPy group I read that avbin.dll generates some problems on 64 bit Windows machines, but as far as I know this problem should be solved now.

Any suggestion?

Thanks.

Andrea

Comments

  • edited March 2013

    Hi Andrea,

    Your code is fine. It works for me with PsychoPy 1.76.00 on Kubuntu 12.04.

    From the PsychoPy group I read that avbin.dll generates some problems on 64 bit Windows machines, but as far as I know this problem should be solved now.

    From the error, it seems as though there is simply a bug somewhere in PsychoPy, not something related to avbin.dll (I think that would result in hard crashes, but I'm not a 100% sure). What version of PsychoPy do you use? In OpenSesame you can check this by typing modules() in the debug window. If you are up-to-date and still get this error, it might be worthwhile posting it on the PsychoPy mailing list.

    Edit: It could also be that PsychoPy cannot find the file, or that it cannot handle the video format. It's quite often in PsychoPy that crashes are not dealt with gracefully and result in uninformative error messages.

    Cheers!

    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 8:30AM

    Hi Sebastiaan. You were right, the problem was due to something in the video format. It sounds strange, because my initial video was an uncompressed AVI. I re-created a compressed video and now it works.

    Btw, in order to make my initial code funcioning, it has to be added a loop, so:

    from psychopy import visual
    
    mov = visual.MovieStim(exp.window, 'C:/Users/Andrea/Desktop/Movie.avi')
    while mov.status != visual.FINISHED:
        mov.draw()
        exp.window.flip()
    

    Cheers,

    Andrea

Sign In or Register to comment.