Pavlolvia constraints when using many large video files?

Hi Everyone-
We’re new to online experiments. In our experiments, we are planning on presenting many (~200) large video files (~10mb). We can easily do this using PsychoPy, but are folks aware of any constraints on doing this online via Pavlovia? I believe that Pavlovia loads everything into the browser’s memory before the experiment starts. Besides this taking quite some time for our experiment, should we anticipate any other problems?
We just wanted to find out before we tried setting it up online.
Thanks so much! And I apologize if this information already exists in the forum.
-Larry R.

Hi Larry, thanks for getting in touch. In theory no, that is permitted but in practice, right now, we would struggle! The server is pretty full and due to move next Sunday to a new more powerful machine, so if you could hold off uploading your full study until then it would be great!

Long term @apitiot and I are going to have to work out what to do about large projects. If lots of people need >2Gb per project then we could be in trouble. So we might one day introduce either caps, or discouraging charges for large projects.

In the meantime, yes there is also the issue that the study will take a while to start for the participant. Again we will look at this in the long term, whether to allow a study to start still while downloading stimuli. It’s possible but we don’t want the possibility of a study going into “buffering” halfway through on a slow internet connection, hence the current strategy.

Thanks so much, Jon-
This is really useful information, and I am glad that our projects could work in principle. We will absolutely wait until next Sunday to try a full upload. As we try things out, I’m happy to share our experience on how the stimulus pre-loading strategy works.
Thanks for creating and supporting such a great set of projects which have become so useuful for so many of us at the current time.
-Larry

Hi there!

I want to revive this conversation because I’m about to launch my experiment online and it does contain a lot of videos for my stimuli. I’m really concerned that it will take hours for the experiment’s material to download on my participants’ computers. Therefore, I was thinking of uploading all my videos on google drive and pulling my stimuli from there, is that something possible?

Would it be a better option?

What do you think? @jon @wakecarter

Thank you in advance for your time and your help!

You could try the embedded html method.

Another possibility is to download the videos in code (prepareResiurces) or using Resource components during the experiment.

Uploading your movies to google drive doesn’t solve the problem that, at some point, the movies have to get to your participant’s computer.

Youtube is possible but transmits the video while it’s playing which potentially leads to buffering issues. If it doesn’t matter exactly when the video starts playing (if it takes time to load the first frames) or if it pauses to buffer further data then this could work. The other good thing about this is that the files aren’t in your experiment repository so not taking up space on your computers or our server.

But if timing matters I would definitely recommend using the Resource Manager or Static Component (which uses Resource Manager behind the scenes) that are now built in to Builder.
image

With Resource Manager you can decide when to start loading resources and, optionally, when to check/wait for them to complete. You could use this to load all your movies while the participants read through the instructions and consent screens and then wait for them to complete before actually starting the trials. You could even fetch a small set of stimuli initially and then fetch the rest while practice trials run. All this obviously depends on whether you have some lengthy period at the start before your main trials.

With a Static Component you could fetch each movie during an inter-trial interval, while the screen is ‘static’ with just a fixation point or similar. That has the extra advantage that you only ever load the files that the participant will need (e.g. if not all participants see all the available stimuli).

Which method works best will depend on how many stimuli you have, how long your inter-trial intervals are etc, but both of these methods still involve the stimulus being fully downloaded before the trial starts which is good if timing precision really matters to you.

Both of these options are relatively new and are continuously improving, so do make sure you’re using a very recent version of PsychoPy (check the latest version)

1 Like

Thank you for taking the time to answer my question.

Would you be kind enough to expand on the other possibility you mentioned? I’m not quite sure to understand what you mean by “to download the videos in code” I’m getting started on PsychoPy and don’t have much experience. Thank you!

Thank you for your answer.

The thing is that we have done a similar experiment before with only images as stimuli, and it took 40 min for participants to download everything they needed to complete the experiment. Given, that our next experiment will be using videos, I’m concerned that it will take close to 90 min to download everything.

Here’s some sample code from an experiment I’ve currently working on. It appears in Begin Routine in a JS only code component and downloads the materials for the next trial.

if (((NextSlide === 1) || ((NextSlide >1) && (expInfo["group"] === "2")))) {
    nextSound = [{"name": (("slides/Slide" + (SlideN + 1).toString()) + ".JPG"), "path": (("slides/Slide" + (SlideN + 1).toString()) + ".JPG")}];
    nextSound.push({"name": ((("sounds/slide" + (SlideN + 1).toString()) + ".") + soundExt), "path": ((("sounds/slide" + (SlideN + 1).toString()) + ".") + soundExt)});
    console.log(nextSound);
psychoJS.serverManager.prepareResources(nextSound);
} else {
    if (((expInfo["group"] === "1") && (NextSlide > 1))) {
        nextSound = [{"name": (("slides/" + (SlideN + 1).toString()) + "a3.jpg"), "path": (("slides/" + (SlideN + 1).toString()) + "a3.jpg")}];
        nextSound.push({"name": ((("sounds/" + (SlideN + 1).toString()) + "a3.") + soundExt), "path": ((("sounds/" + (SlideN + 1).toString()) + "a3.") + soundExt)});
        if ((NextSlide > 2)) {
            nextSound.push({"name": (("slides/" + (SlideN + 1).toString()) + "b3.jpg"), "path": (("slides/" + (SlideN + 1).toString()) + "b3.jpg")});
            nextSound.push({"name": ((("sounds/" + (SlideN + 1).toString()) + "b3.") + soundExt), "path": ((("sounds/" + (SlideN + 1).toString()) + "b3.") + soundExt)});
            nextSound.push({"name": (("slides/" + (SlideN + 1).toString()) + "c3.jpg"), "path": (("slides/" + (SlideN + 1).toString()) + "c3.jpg")});
            nextSound.push({"name": ((("sounds/" + (SlideN + 1).toString()) + "c3.") + soundExt), "path": ((("sounds/" + (SlideN + 1).toString()) + "c3.") + soundExt)});
        }
    console.log(nextSound);
        psychoJS.serverManager.prepareResources(nextSound);
    }
}
1 Like

Hey @jon, I’m using v2022.2.5, but I can’t find the Resource Manager under Components and Custom.


Let me know how to fix this. Thanks!

Check your component filter for online plus offline

Thank you it worked. Would you be kind enough to explain what are the preload actions? I’m not sure to understand what does ‘start’ as well as ‘check’ do?

Start means start downloading the given resources.

Check means check whether they have finished downloading.

According to Resource Manager Component — PsychoPy v2023.2.3

The resource manager has an attribute “status” and we can check if it has finished using resources.status == FINISHED (where resources corresponds to the name of your resource manager component).

1 Like