Video skips frames unpredictably in Pavlovia

URL of experiment: https://run.pavlovia.org/Aurelio/metacognition-of-coherent-motion-perception/html/

Description of the problem:
In the experiment, two brief videos (600 ms each, randomly chosen, for every trial, from a list of 32 videos) are sequentially displayed. Every now and then (not very often and unpredictably), the videos seem to freeze briefly or they appear to be presented for a shorter duration. Is there something else I can do to make sure the videos are always played smoothly and for the expected duration?

Thank you very much in advance.

Sorry, I should add that the videos are all .mp4 files, FPS = 60, Format: H.264, 1440X900, no sound.

Hi @aurelio.bruno, thanks for flagging, would it be possible to try exporting HTML from PsychoPy versions past 2020.2.5, which bring in a few video playback related improvements, and post back if that fails to solve the problem? Here to help, thanks, s.

Hi @sotiri, thank you for your kind reply.

I’ve just installed version 2020.2.8 and synced my script with it. I can still see some glitches. They’re very infrequent (they occur, on average, in 4-5 trials out of 100), but they’re still there. Do you think that changing the orientation of the videos at every trial can contribute to the glitches?

Thanks again,

Aurelio

Hi @aurelio.bruno, no problem, let me try digging a little deeper, s.

1 Like

Great, thanks a lot.

Hi @sotiri, any luck with your digging? Cheers.

Hi @aurelio.bruno, sorry it’s been an extremely busy few days, I really appreciate your patience while I work to get this fixed, s.

Sure, no problem at all. Thanks a lot for your effort.

Hi @aurelio.bruno, sorry to keep you waiting, I have staged an alternate version of your project using PsychoPy latest. Would it be possible to give me an example of what the glitches look like? Thanks, s.

Hi @sotiri, thank you for your reply.

I’ve just run a few trials of my experiment on your alternate version twice. The first time,I saw a glitch during the second practice trial, the second time, it was the third trial. As I said in my original message, they seem to be quite unpredictable and affect only one of the two test videos (in each trial, there are two sequentially displayed videos).

When I say that I saw a glitch, I mean that it looked like one or more frames were dropped during the presentation of the video, therefore the impression of motion in my stimuli is not as smooth as it should be (and as it is in most trials). Sometimes, it also looks like the two videos are not displayed for the same duration (one seems to stay on for a shorter interval).

I’m not sure I can be more specific.

Hi @aurelio.bruno, OK, alright, that helps a lot, thanks, x

Hi @sotiri,

I hope this message finds you well.

I guess the problem with my experiment doesn’t have an obvious solution.

I just wanted to let you know that I made some more changes to the videos and to the script, but the overall situation did not improve. Also, I found out the experiment works poorly on most of the Windows browsers.

Cheers.

Hi @aurelio.bruno, sorry, yes, it’s a tricky one this and I really appreciate your patience while I try to find what is causing the problem so I can fix it. It’s at the top of my list. Thank you, s.

Hello all,
I am also having this same problem. My video clips are between 1 second and as short as 233 ms (14 frames). I am having the same issue where there are skips when the experiment is run in the browser. When run locally, I do not have any issues. I just wanted to see if there have been any updates on the issue or any potential solutions.

Hi Matt,

no updates or obvious solutions, I’m afraid. At least, on my side. I know that someone with the same problem started using frame timing, but I haven’t tried it myself.

Cheers.

Frame timing has not worked for me. Here is a clip of my experiment showing my trial procedure. Even when using frame timing it still skips.
https://run.pavlovia.org/mattpeel/video-test/

It seems to work fine on my machine, I don’t see any glitch or obvious skips, at least. Have you tried it on different browsers or on different operating systems? My problem is worse on some browsers and better on other browsers.

Mine works perfect on my machine when run locally. It must be something connected to the videos being downloaded and accessed in the browser. Perhaps the browsers are simply not capable of producing video perfectly in this scenario, or maybe it is due to some data loss when the files are compressed. Mine appears to be more frequent than your issue ( about 1 in 4 videos). I have tried on google chrome and safari. I am working on having some friends test on their PCs to see what it looks like.

Dear @aurelio.bruno, sorry to have kept you waiting. The screen recording below is of plain HTML video playback and no rendering is done on canvas as might be the case by default. Would it be possible to please review whether the result is glitch or error free? Thank you, s.