Howdy, Stranger!

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

Supported by

[solved] Problems Using Multiple Videos

edited June 2013 in OpenSesame

Hi there,

I am having trouble running an experiment with a loop of 16 videos:

image

I'm using the video player set up like so:

image

However, when I run the experiment all I get is a blank screen, yet after making 16 allowed responses the experiment ends as it should. I have no trouble playing videos in OS, the experiment works fine with one video (using the name of the file instead of [Actor]). Also if I put anything before the video player (e.g. a fixation dot) it just stays on the screen and does not disappear as it should.

Is there something I'm doing wrong?

Comments

  • edited 12:43AM

    Hi,

    The video_player hasn't been updated for a long time (it's deprecated in favor of these options, although these may not work for Mac OS). What you are running into is that the video_player doesn't support the [variable] notation. Only direct names work.

    Fortunately, you can work around this through a hack, by placing the following code in the Prepare phase of an inline_script item that you place before the video_player:

    exp.items['video_player'].video_src = self.get('Actor') + '.avi'
    

    This script sets the video_src variable for the video_player item, and allows you to refer to another variable, in your case Actor. Does that make sense?

    Hope this helps!

    Cheers,
    Sebastiaan

  • edited June 2013

    Hi Sebastiaan,

    I'm not very good with code but tried what you said:

    image

    However now I'm getting an error:

    image

    Have I missed something?

    Chris

  • edited June 2013

    Hi Chris,

    Let's walk through the command. exp is the experiment object:

    exp
    

    The experiment has a property items, which is a dictionary of all the items:

    exp.items
    

    In this dictionary, the item names are the keys, so you can get the Emotion item like this:

    exp.items['Emotion']
    

    You can change attributes (i.e. variables) of the item like this:

    exp.items['Emotion'].video_src = self.get('Actor') + '.avi'
    

    Does this make sense? So the problem was that you didn't specify the name of the item, which is Emotion, but just copied the code that assumed the item was named video_player.

    Cheers!
    Sebastiaan

  • edited 12:43AM

    Ah excellent! Haha I told you I was new to this.
    So the videos are displaying now (and in a random order which is great) but they still don't play? I just get a still image of the first frame......
    Sorry to be such a bother!

    Chris.

  • edited 12:43AM

    I just get a still image of the first frame......

    Have you set the duration to a very low value? You can set the duration to 'keypress', to play the video until you press a key, or to a value in milliseconds.

    Cheers,
    Sebastiaan

  • edited 12:43AM

    That was it. I'd been following the catface tutorial and so I'd set the duration to 0. Excellent, it's working well now, thanks for all your help!

    Chris.

Sign In or Register to comment.