Showing multiple videos on OpenSesame
Hi!
I'm new to OpenSesame, and I would like to conduct an experiment where a sound plays at the beginning, followed by the simultaneous display of three or more videos on the screen in different positions. Participants need to match the sound with the correct video by touching and subsequently stopping it. I have successfully implemented a similar task with images, but I'm unsure how to achieve this with videos.
So far, I've set up a loop and a sequence inside that includes a sound and a media player. In the loop, I defined variables such as Video1, Video2, and Video3 in their respective columns. I also added three columns for different positions (e.g., Posx1, Posy1, Posx2...), and I scripted the shuffling of positions and videos to ensure a varied order, similar to what I did with images in a previous task.
I attempted to add a video in the media player (mpy), aiming to replace the file name with the variable names [Video1][Video2][Video3], but this approach did not work as expected.
Additionally, I would like to link the columns Posx1 and Posy1 to Video1 and so on. However, unlike with images, there is no editable script to replace the x and y values. I read in the forum that using an inline script with OpenCV might be a solution, but I'm not sure how to implement it. Is there a way to accomplish this task without adding a script directly? I truly hope someone can provide guidance!
Thanks so much!
Comments
Hi @Giuliannicch,
No, unfortunately this won't work without scripting. The Media player only works for a single video at a time. So yeah, I would go for OpenCV. But start simple, don't focus too much on your paradigm. Perhaps first try to present a single video on the canvas. If that works, try to adjust the size/position of it. And if that works, Adding other videos to other locations will not be as challenging as it seems now.
And if you get stuck on the way, we can try to help out.
Eduard
ps, you can always get inspiration from examples/tutorials: https://osdoc.cogsci.nl/4.0/manual/stimuli/video/#opencv
Thank you so much for the answer and the advice!
I'll give it a try!
Giulia
I have another, perhaps silly, question, but as i said I am new to programming and OpenSesame. Once I manage to define the four videos I want to present simultaneously with an inline script, to create the loop, set the correct responses, add sound, etc., can I use the graphical part, meaning adding columns with the variable "sound," the variable "correct_resp," etc., or do I have to do everything through the script? I mean, now that I've added the inline script, my experimental loop will execute that, but I would like to use it only as an instruction to display the four videos simultaneously, not also, for example, to give the random order, associate the sound, etc. And where is the right part where to put the script? I hope I have explained myself well!
Thanks again,
Giulia
Hi Giulia,
Normally you should still be able to use the loop table. However, depending on your setup you might need to be a bit creative with the labeling. For example, because all the videos are now in one trial, you essentially need 4 columns with video_name, 4 columns regarding the sounds, correct_response, etc. But sure, there is no reason why this shouldn't be possible.
Eduard