psychopy.org | Reference | Downloads | Github

Fail to set video size online

URL of experiment: time_emotion_integration [PsychoPy]

Hi all,

I’m now piloting an experiment where I need to display sequences of short videos. It seems that I failed to set the video size online. Offline, the videos showed without a problem. Yet online, some (not all) of the videos seem to be too large that they exceeded the full screen (as shown in figure below). I wonder if there is some problem with the way I set the size of the video. Thanks!

I’m using .mp4 for videos with h.264 codec, and the unit of size is height. I checked the crib sheet and other posts on the forum for videos and didn’t find a solution.
Also, no error message in the console.

My video properties in psychopy.

A video that showed successfully.

A video that fail to show.

I’m afraid that I can’t access your experiment, but I do have a suggestion. I’ve seen this happen with videos scaled in height units, but with the size of the video being something like [1024, 768], which makes your video basically 1024 times the width of the screen. Could that be it?

Hi Thomas–I’m still piloting the study. Is this why you cannot get access? And I set the size to be [0.85, 0.5] for all the videos under height. So seems this should not be a problem? As a follow-up note I tried to set the size as [0.8, 0.5] (considering the decimals might cause the problem), this seems to solve the problem for some videos but the problem remains for some others.

And just to clarify I have a single routine for all the videos so the settings for all the videos are the same. It’s quite strange why this happens only to some but not other videos.


Yes, the piloting is probably the reason I can’t get in. No matter though, let’s do some debugging! I see you’ve got a couple of code components. Maybe try to log some info in the browser console when a video acts up? There are two ways you can get there:
1… Log debug output: Thomas Pronk / tutorial_js_console_log · GitLab
2. Make your video accessible from the console: Thomas Pronk / tutorial_js_expose_psychojs · GitLab

Thanks for the suggestion! I will try if I can get more info with this.
For now, I set the study to be running in case it’s helpful (but it’s private as the videos come from a database that is not open). https://pavlovia.org/run/isabelschuman/time-emotion-integration
Also I checked in the browser console when video fail to show and found no error.
Thanks again!

Those are quite a lot of videos! If you could make a special version of the experiment that would only present one of the failing videos, I could take a look, but without developer access I’m limited in what I can do. In reference to the tutorials I shared: you could check if there is anything weird with the properties of the video component (their height and width, for example)

Hi Thomas–I don’t have time to try log video info to debug today but here is what I’ve found for now:

  1. Sorry I should have created a shorter demo but seemed that the failing videos was not a fixed set.
  2. Initially with the video size of [0.85, 0.5], I got the error mentioned above (kept happening for days);
  3. I set the video size to be [0.8, 0.5], re-synced the experiment → problem solved for some videos but not for all;
  4. I then re-synced the experiment without any change → problem solved for all videos!
  5. I then tried the initial size [0.85, 0.5] again → no problem for all videos!

I will re-test the exp for several times later but it’s just so weird :rofl: Could it be an issue with synchronization due to my slow internet? Thanks again for all your help.

1 Like

Well… yeah… probably there is some logical explanation, but I’ve got not idea what. Generally speaking you have a whole sequence of things happening, and it can go wrong on all kinds of levels. That’s why we devs like to log idiotic amounts of debug data and have whole test-batteries.

If you don’t have the time to dive into debugging, but this solved it, fine with me :slight_smile: Likely it will stay fixed btw.