Description of the problem:
I created a demo for my experiment to see whether I can run it online. I have a loop sequence start with a word for 2s and a blank page for 0.5s then a sound for 600s and a video clip for 2s with background noise. Everything is fine on the computer, but when I run it for piloting everything is fine except for videos I have the background noise (the sound) of videos but not the video. My video file format is mp4 and you can see the other setting for videos in the following picture.
Not entirely sure what’s going on, but here’s a couple things to try and see what happens:
Try changing the units to “pix”
If I’m seeing this correctly, the movie itself doesn’t have sound, it just plays while a sound element plays in the background? Try disabling the sound temporarily (in the “testing” tab you can turn a component off for testing purposes, very handy for things like this).
This is mostly trying to narrow down what the problem is rather than fix it outright. Also, if that doesn’t work, you can link your gitlab repository (view code, then go to settings->general->permissions) so we can have a closer look at the experiment.
Thank you, Jonathan, for your response. I changed the units to “pix” and I opened the view code for the public. I also disabled the sound stimuli but still, I don’t have the videos when I run it online.
In my experiment, there is a sound stimulus related to an object (e.g.,the sound of a violin) that run 100ms before the video clip onset and they play for 600ms. I changed the sound of videos with background noise and then I saved them with mp4 format. So, each video has a sound look like the noise in our environment. Now, when I run my experiment online I just hear the two sounds (sound stimuli and sound of the video) but I can’t see the videos.
I am wondering if the problem related to:
After copying your experiment and doing some careful process of elimination, it appears to be an issue with the video files themselves. I can get other mp4 files to play, even in your experiment with all the settings as you have them, but not your videos.
The issue may be the encoding. They are currently MPEG-4 encoded, whereas the videos I can get to work are h.264 encoded (and saved as .mp4 files). If you are able to re-encode your videos with h.264, that might be your best bet.
Thank you Jonathan so much. I encoded the video files to h.264 an now the videos of my experiment run online without any problem, but there is a little problem, when I press the “y” or “n” as response key before finishing the video (because the response keys are available as the video clip become on), the sound of the videos still remain playing to the end of the video frame (2s) while the next trial is present.
Hi everyone and thanks for the suggestions made so far. I have problems showing videos in my experiment; I tried to convert them into h.264.mp4 files, but I still get some errors. Not sure what the problem is, can anyone please help?
I also have a problem with running video files in Pavlovia (an experiment in a pilot mode now).
The files are in html/resources/images on Gitlab, I have tried different formats (mov, mp4, h.264.mp4, currently working with h.264.mp4 files), but the same problems persist.
I have two video routines: one with the constant movie file (the example), the other with movie file set every repeat from the loop file. (the trial video). Both work just fine on my computer, but different problems occur with the two routines online.
The first example video (constant) is played, but after it ends, it does not disappear and therefore overlaps with the text that should follow the video.
The trial video (set every repeat from file) can’t be seen on the screen. If you exit the full-screen mode while the video is playing, you can catch the end of it, but if you proceed to the next video, it does not play as well. I do not get the error messages.
I have the same problem; I have a loop that’s supposed to display different video every repeat, but the video file is nowhere to be seen and once you exit the full-screen mode the video is playing albeit it stops after one go whereas it should loop. I tried different formats and settings (with size and no size, pix, height etc.) and nothing seems to fix this. Does anyone have any ideas?
Thank you in advance!!!
Wakecarter, thanks for your reply. Currently, I have a loop with several repeats of which some have the video playing, and some not. The way I achieve this is by having a video component start when my video_swicth is True. Do you think this is causing the problem? I could, of course, make it so that each repeat is, in fact, separate routine although having one loop seemed like an elegant solution at the time.
Thanks @wakecarter and @feygele!
I managed to do it. As suggested, I added videos on every repeat and I change opacity to 0 when I don’t want any videos playing. That plus some size adjustments to my videos and a 0.5 start delay and voilà!
I am having a similar issue. I can’t see my videos on Pavlovia but can hear the audio, though they work perfectly in PsychoPy. I made a separate experiment just with one movie component to see whether the videos were the problem or some other code of my bigger experiment, but the videos still don’t work! So I am thinking it’s a problem with the videos, but cannot figure out what.
I have coded the videos from .mov files to h264 mp4 files with AAC 44100 Hz audio, as I have seen recommended and still nothing. You can see the details of the videos here:
Thanks so much for your reply! I have added you now. Apologies that there is quite a lot in that folder, as it’s the same one I used for my larger experiment too, not just the test. The psych file you want is called ‘movie_test.psyexp’.
I have tried to run the experiment in both Chrome and Edge and both have the same issue. I’m using Windows 10.
Hope this helps, let me know if there’s anything else you need!
I managed to solve half of the problem: your experiment uses height units, in which case 1 is the full height of the screen. You specified [700, 400], so the video got blown up immensely. This can be fixed by specifying, for example [0.7,0.4].
There was some other issue though: in VLC player and in my web-browser, the first couple of seconds the video didn’t play, but after that it did. Didn’t have that problem using Windows 10’s equivalent of Window Media Player though.