psychopy.org | Reference | Downloads | Github

Using GIFs as stimuli, running online through Pavlovia

URL of experiment:
https://run.pavlovia.org/Mende-SiedleckiLab/srpv1/html/

Description of the problem:

I’m trying to run a task that uses GIFs instead of still images. It works perfectly in builder using the movie stims. When I tried to use the image component, the GIF was static so I switched to movie instead.

When trying to test the task in Pavlovia, I get the following error:

  • when setting the movie of MovieStim: movie
  • the argument: [object HTMLImageElement] is not a video" }

Has anyone had success running GIFs on pavlovia? Should I keep them as image components even though they’re static in psychopy?

Any help appreciated :slightly_smiling_face:

I replicated the error in both Chrome and Edge under Windows.

The solution I found was to convert the animated GIF to H.264 MP4 format. The easiest way to do this is probably to use free software such as Hand Brake. If you do, then ensure that the file extension is definitely .mp4 and not .m4v, because the latter will not work. If you are looking to loop the animation, then Chrome does so smoothly, while Edge seems to pause slightly with each loop.

Thank you! I converted everything to mp4 and they do seem to be appearing in my task (though the size does not seem to reflect settings in psychopy- all stims are super zoomed in and huge, they take up the whole screen).

I could not open the experiment linked above (perhaps it is not publicly accessible). So, I could not observe the problem for myself.

The cause of the problem might be the choice of units in the experimental settings. It is also possible to change this for each movie component of the experiment, where pixels is often a good choice. It is usually best to leave the global preference as height to make text sizing easier.

Assuming that you have resized all of your movie files to their intended display size (in pixels), then you can safely leave the Size field of each movie component blank, so that the actual size is used by default. The same applies to the Position field, if you intend the movie to be centred on the screen.

Thanks for the help and quick response! I actually did originally have it blank. The display size was a bit larger than what I would have wanted but nothing close to what was displayed. The stims were faces and it was large enough/zoomed in enough that you could just sort of tell that the display was a flesh tone but no sign of a face.

It ran fine locally in python and only zoomed in when on pavlovia. Ultimately, I set the movie component to a specific size (in pixels), which fixed the issue. All of the movies were the same size so it wasn’t a problem.