| Reference | Downloads | Github

Presenting image stimulus after a short video (600ms)

Dear researches,
I am using the 2020.2.10 version of PsychoPy

What do I want to do?: I want to present 600 ms short videos and after the video (.mp4) I want to present a picture (.jpg) for 400 ms right away.

What is the problem?: Although videos are 600ms when I set the duration of the video to 600ms [i.e., start: 1, duration: 0.6 in time(s)] I cannot see the whole video. It seems like it plays until 450-500ms approx and the next image shows up.

I tried to create two routines (i.e., video and picture) under the same loop instead of creating one routine and putting both image and movie components under the same routine. Routine named video only consists of the movie component and ends in 600ms and the next routine has the image and response component. But still, I cannot see the whole video.

This is the first time that I use the movie component so I am not very experienced with it.

-Is it possible that videos are playing slower on Psychopy?
-or should I use Frames instead of seconds regarding the duration of the video?
-or should I make the image component with a conditional start (i.e., start after video finishes). And if yes how can I do that?

Thank you in advance!

Hey! Just a quick suggestion: try it with the newest PsychoPy. It features a lot of improvements on movies.

Dear @thomas_pronk ,

Sorry for the really late response and thank you for your suggestion.

I have updated my PsychoPy to the newest version however I still have some problems.
My videos are 600 milliseconds (36 frames with a frame rate of 60frames/seconds). When I set the movie component to “frame N = 36”, it seems like not all the videos are played. Around last 100 ms of the video is not played at all.

Is it possible that there are some delays in the online version?

Thank you so much,

What happens if you set the frame N to 42? Does the last 100 ms play then?

@thomas_pronk Yes technically setting the frame N to 42 (or higher) plays the whole video, but that results in longer videos (around 718ms) than I want to present. The video duration has to be as precise as possible (600 ms) for the experiment.

Do you know why that happens?
Should I create faster versions of videos?

I’m not sure why it happens. For now I can only speculate, though we’re developing some timing testing tech that should turn my speculation into a testable hypothesis. Don’t wait on that though; it’s complicated stuff :).

My speculation is that for video, the browser prioritizes that the video plays fluently. From the moment we request the video at PsychoJS, it waits a little moment to get ready (those 100ms) and then starts playing. We can’t detect when a video actually starts playing; only when we made the request, so that’s when our timer starts counting. Stopping the video doesn’t require any preparation, so that happens immediately. Hence, 100 ms get cut off, which might be different on other platforms btw.

How to fix this? I’d recommend to just play the video, no stop time. You’ll be sure it played in full, bit you’re unsure what T=0 is for your RTs. Depending on your research question, this need not be a problem. If this option is worth considering, give a shout and I can send some papers about it.

Thank you so much for the information! It really helped a lot for me to understand.

I have one small question as well (maybe better as a new topic but I was not sure).

My videos are 60 frames/seconds but I have started to collect data and some participants have monitors with really high frame rates (i.e., 144). So they see the stimuli almost 2 times shorter.
Is there any way to solve this problem?

Thanks in advance,

You’re welcome! About your question: I’d expect that on a 144Hz monitor a 60Hz video would play just as fast. The browser should interpolate to assure this (like playing every video frame 2/3 monitor frames). I’d be surprised if this isn’t the case. Have you verified that the videos are actually almost 2 times shorter?