Millisecond Forums

Stimulus overlay on video

https://forums.millisecond.com/Topic13508.aspx

By Timmojh - 6/9/2014

Hello, I'm new to the Inquisit universe so apologies if this has been asked previously!

I'm looking to overlay stimuli (e.g. images, shapes) over a playing video at set intervals during a trial. However, I'm not able to make this happen currently, not sure if anyone has any experience of this or if it is possible?

Ultimately I would like to run something like the Pursuit Rotor Task over the top of a video, but think this may be a bit optimistic for the time being?!

Regards,

Tim
By Dave - 6/9/2014

You cannot easily overlay <text>, <picture> or <shape> on top of a video. Think about it: A video is moving pictures, i.e., the screen portion displaying the video has to be redrawn all the time. Any static stimulus (e.g. <text>) you draw in this region will be visible for a single frame only. Two options:

#1: You either need to redraw your static stimuli every frame (which may not be possible to do depending on other aspects of your procedure).

/ stimulusframes = [1=myvideo; 2-1000=mytext]

#2: You *can* overlay other <video>s on top of each other. So, instead of using a <shape> or <picture>, prepare videos of your stims and properly set up <video> elements for them.
By Timmojh - 6/19/2014

Thanks Dave,

Does make sense now you mention it!

Just on the topic of drawing static stimuli, how does Inquisit decide on the order of presentation? For example, if I have 3 elements "A", "B" & "C" which have a degree of overlap and drawn on the same frame (e.g. /stimulusframes = [1=A,B,C]) which will come out on top ? - Realise I can just try this for myself, but I'm away from my computer at the moment!

Also, Inquisit handles different video formats, is there any it generally works better with?

Tim
By Dave - 6/19/2014

They are drawn in the order given, left to right. Here A first (bottom), then B (middle), then C (top).

As for video formats it depends on the systems you are aiming at. For Windows, WMV is a pretty safe bet. For maximum cross-platform compatibility, you'll want to pick something like an MPG2 codec. You'll find this covered in the documentation for the <video> element.