Millisecond Forums

Regarding presentation of a video stimulus.

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

By dhanya - 2/7/2011

Hi!


I am starting to learn inquisit, and I would like to know how we can play a video file through Inquisit 3 by pressing the ENTER key on mouse. My video stimulus have duration of about 300ms and i need to repeat the video stimulus for about 150 times for evoked potential recording. I would also like to know how to send triggers (TTL pulses) from Inquisit to an external device.


Thank you 

By Dave - 2/7/2011

I am starting to learn inquisit, and I would like to know how we can play a video file through Inquisit 3 by pressing the ENTER key on mouse. My video stimulus have duration of about 300ms and i need to repeat the video stimulus for about 150 times for evoked potential recording.


You'll want to go for a setup along these lines:


<defaults>
/ inputdevice = mousekey
</defaults>

<trial mouseclick>
/ stimulusframes = [1=clickmessage]
/ validresponse = (lbuttondown)
</trial>

<text clickmessage>
/ items = ("Press left mouse button to start the video")
/ erase = false
</text>

<trial playvideo>
/ stimulusframes = [1=myvideo]
/ validresponse = (noresponse)
/ trialduration = 300
</trial>

<video myvideo>
/ items = myvideoitems
/ playthrough = true
</video>

<item myvideoitems>
/ 1 = "01.avi"
/ 2 = "02.avi"
/ 3 = "03.avi"
/ 4 = "04.avi"
/ 5 = "05.avi"
</item>

<block myblock>
/ trials = [1-5=sequence(mouseclick, playvideo)]
</block>


I would also like to know how to send triggers (TTL pulses) from Inquisit to an external device.


You'll want to study the documentation topics "How to Present TTL Signals Through the Parallel
Port", "How to Use the Parallel Port Monitor Tool" and the language reference for the <port> element. The "Auditory Oddball Task" available from the Task Library at millisecond.com may serve as a reference implementation. Searching the forum for terms such as "TTL", "Parallel Port", "trigger", etc. will bring a number of threads containing additional information and tips.


Regards,


~Dave

By dhanya - 2/9/2011

hi sir, 


Thank you, it worked out well. But iam not able to loop the stimulus (i.e continouously play the stimulus for about 150 times). Also i wanted to know  how to set interstimulus interval between video stimulus and to send trigger pulses only for the audio stimulus in the video.

By Dave - 2/9/2011

But iam not able to loop the stimulus (i.e continouously play the stimulus for about 150 times)


Please be more specific about your design. I.e. do you want to repeat the video 150 times on a single <trial>? Or do you want to have 150 <trial>s, each displaying the same video? Also, are participants supposed to respond to the video stimulus or just watch it? Note that Inquisit collects only a single response per <trial> element.


Also i wanted to know  how to set interstimulus interval between video stimulus


Please study the "How to Control Trial Duration and Inter-Trial
Intervals" topic in the Inquisit documentation. Also, please complete the tutorials in the Inquisit helpfile to get an overview of the basic syntax features.


and to send trigger pulses only for the audio stimulus in the video.


That's not possible. If you want to send triggers at specified times during the video, you have to set up appropriate <port> elements and send them out via /stimulustimes. Note that there's no way to guarantee perfect synchronization between triggers and the video's soundtrack. As for general information on how to interface with external equipment via TTL, please refer to the resources I mentioned in my previous post.


Regards,


~Dave

By dhanya - 2/14/2011


Hi Dave,


I am sure you will clarify  this for me. Now the video is playing well and i could loop it too, but triggering is the problem. How to go about with the parallel port LPT connections. Neuroscan equipment which we are planning to use have a 25 pin male connector. how to know which port to use (LPT 1 or LPT2) and is there anything to be set in the Inquisit software to enable this triggers to be sent. we need to send an 8 bit TTL pulse to Neuroscan equipment for it to recognise the triggers. i need to set only one trigger at the onset of the video.


Thanking You in advance. 


By Dave - 2/14/2011

As I had mentioned previously, you need to properly set up a
<port> element to send triggers to external equipment such as NeuroScan. Thus:


how to know which port to use (LPT 1 or LPT2)


You use the LPT port Neuroscan is connected to on the PC. Either


<port onsettrigger>
/ port = LPT1
[...]
</port>


or


<port onsettrigger>
/ port = LPT2
[...]
</port>


and is there anything to be set in the Inquisit software to enable this triggers to be sent


The 8-bit TTL signal to be sent is defined in the <port> element's /items attribute. For the specific signal NeuroScan expects as well as other NeuroScan-specific settings (e.g. the subport to use) refer to the NeuroScan documentation.


<port onsettrigger>
/ items = ("00000001")
[...]
</port>


Once this is set up properly, you need to send the trigger out at the desired time via your <trial> elements' /stimulustimes or /stimulusframes attributes. E.g.:


<trial mytrial>
/ stimulusframes = [1=myvideo,onsettrigger]
[...]
</trial>


You may test connectivity between Inquisit and NeuroScan by using the Parallel Port Monitor tool.


~Dave


By dhanya - 2/16/2011

Thank You Dave it worked...


But now when the command "onset trigger" is given, i am getting a trigger value of "1" only at the onset of the video stimulus.  But for my task, i have to the play the video 150 times and get a trigger for each trial (i.e. for each video). How to go about with this problem. The script i'am using presently is given below:



<defaults>


/ input device = mousekey


</defaults>



<text click message>


/ items = ( "Press left mouse button to start the video")


/ erase = false


</text>



<port onsettrigger>


/ port = LPT1


/ subport = data


/ items =  ("00000001")


</port>



<trial play video>


/ stimulusframes = [1=myvideo, onsettrigger]


response = timeout(500)


/ validresponse = (" ", noresponse)


/trialduration =10000


</trial>



<video myvideo>


/ items = myvideoitems


/ playthrough = true


/ loop = true


/ size = (90%, 90%)


</video>



<item myvideoitems>


/ 1 = "ba - ba.avi"


/ 2 = "ba - ba.avi"


/ 3 = "ba - ba.avi"


/ 4 = "ba - ba.avi"


/ 5 = "ba - ba.avi"


</item>



block myblock>


/ trials = [1-5=sequence(mouseclick, play video)]


</block>




There is some error with the trial no also. I am not able to play it 150 times.


Thank you in advance......

By Dave - 2/16/2011

i am getting a trigger value of "1" only at the onset of the video stimulus


Which is what you asked for.


But for my task, i have to the play the video 150 times and get a trigger for each trial (i.e. for each video).


Please use consistent terminology. Otherwise it's impossible to figure out what you're trying to do. You *don't* want a trigger for *each video*, but a trigger for *each repetition of the same video*. Right? Then the /loop attribute won't help. You'll have to repeat the *<trial>* displaying the video 150 times, with each trial showing the video only once. Then you'll have triggers for each repetition.


Regards,


~Dave

By dhanya - 2/20/2011

hi dave, 


Is there any way to delay the trigger in the video???

By Dave - 2/20/2011

Just send the trigger out at a different time using the /stimulusframes or /stimulustimes attribute of your <trial> element.

By dhanya - 3/8/2011

Hi Dave, 


Is there any way to repeat the triggers in single trail (which contain 150 repetition of same video stimulus)? 

By Dave - 3/8/2011

Suppose your video is 500ms long, then you could go for


/ stimulustimes = [0=myvideo,mytrigger; 500=myvideo,mytrigger; [...]; 75000=myvideo,mytrigger]


However this is wholly impractical. Repetitions won't bee seamless and a single trial may only collect a single response. Otherwise, there is no way.

By Dave - 3/8/2011

Also note that you'd have to send additional erase triggers (i.e. set all bits to low) in between presentations in the above, single-trial scenario.

By dhanya - 3/9/2011

Hi Dave, 


Tried what you have given but i am getting only one trigger for the whole stimulus (or trial). My stimulus contain only one trial which contain a video  (duration of which is 1.5 minutes). This video contains 150 repetition of syllable /da/, the duration of which is about 450 ms.  So my task here is, i need to get one trigger each for one repetition of /da/. So totally now i need 150 triggers for each /da/ repetition in a single trail. Is it possible to get triggers for a stimulus like this, also i need not want to take any responses from the subject. Its only electrophysiological measure without any  behiavioral measure.


Thank you in advance........

By Dave - 3/9/2011

See my previous reply. You need to additionally send another port stimulus between presentations, which resets all bits to zero.


/ stimulustimes = [0=myvideo,mytrigger; 20=bitstolow; 450=myvideo,mytrigger; 470=bitstolow; ... ]


with


<port bitstolow>
/ items = ("00000000")
[...]
</port>


Otherwise the signal will remain raised throughout the trial.

By dhanya - 3/9/2011

Hi Dave,


Thank you very much, it worked well...............

By dhanya - 3/27/2011

Hi Dave,



I am attaching the program which i use for an electrophysiological AV experiment. Now the triggers are coming well, my system hangs or the end frame of my video stays long and  i am not able to interrupt the experiment in between. And everytime  i have to restart my system for next presentation of experiment. can you please help me to get rid of this problem.




<port oddballsignal>


/ port = LPT1


/ subport = data


/ items = ("00000001")


</port>



<port bitstolow>


/ port = LPT1


/ subport = data


/ items = ("00000000")


</port>



<video oddball>


/ items = ("da- da (1000- 350).wmv")


/size = (100%, 100%)


/ volume =100


</video>



<trial oddball>


/ skip = [  if (values.lasttrial == trial.oddball.name) values.skipcount = values.skipcount + 1 else false ]


/ stimulustimes = [350= oddball, oddballsignal; 370=bitstolow; 1350= oddball, oddballsignal; 1370=bitstolow; 2350=oddball, oddballsignal; 2370=bitstolow; 3350=oddball, oddballsignal; 3570=bitstolow; 4350=oddball, oddballsignal; 4370=bitstolow; 5350= oddball, oddballsignal; 5370=bitstolow; 6350= oddball, oddballsignal; 6370=bitstolow; 7350=oddball, oddballsignal; 7370=bitstolow; 8350=oddball, oddballsignal; 8370=bitstolow; 9350=oddball, oddballsignal; 9370=bitstolow; 10350= oddballsignal; 10370= bitstolow; 11350= oddball, oddballsignal; 11370=bitstolow; 12350=oddball, oddballsignal; 12370=bitstolow; 13350=oddball, oddballsignal; 13370=bitstolow; 14350=oddball, oddballsignal; 14370=bitstolow; 15350= oddball, oddballsignal; 15370=bitstolow; 16350= oddball, oddballsignal; 16370=bitstolow; 17350=oddball, oddballsignal; 17370=bitstolow; 18350=oddball, oddballsignal; 18370=bitstolow; 19350=oddball, oddballsignal; 19370=bitstolow; 20350= oddball, oddballsignal; 20370=bitstolow; 21350= oddball, oddballsignal; 21370=bitstolow; 22350=oddball, oddballsignal; 22370=bitstolow; 23350=oddball, oddballsignal; 23370=bitstolow; 24350=oddball, oddballsignal; 24370=bitstolow; 25350= oddball, oddballsignal; 25370=bitstolow; 26350= oddball, oddballsignal; 26370=bitstolow; 27350=oddball, oddballsignal; 27370=bitstolow; 28350=oddball, oddballsignal; 28370=bitstolow; 29350=oddball, oddballsignal; 29370=bitstolow; 30350= oddballsignal; 30370= bitstolow; 31350= oddball, oddballsignal; 31370=bitstolow; 32350=oddball, oddballsignal; 32370=bitstolow; 34350=oddball, oddballsignal; 34370=bitstolow; 35350=oddball, oddballsignal; 35370=bitstolow;36350= oddball, oddballsignal; 36370=bitstolow; 37350= oddball, oddballsignal; 37370=bitstolow; 38350=oddball, oddballsignal; 38370=bitstolow; 39350=oddball, oddballsignal; 39370=bitstolow; 40350=oddball, oddballsignal; 40370=bitstolow; 41350= oddball, oddballsignal; 41370=bitstolow; 42350= oddball, oddballsignal; 42370=bitstolow; 43350=oddball, oddballsignal; 43370=bitstolow; 44350=oddball, oddballsignal; 44370=bitstolow; 45350=oddball, oddballsignal; 45370=bitstolow; 46350= oddball, oddballsignal; 46370=bitstolow; 47350= oddball, oddballsignal; 473370=bitstolow; 48350=oddball, oddballsignal; 48370=bitstolow; 49350=oddball, oddballsignal; 49370=bitstolow; 50350=oddball, oddballsignal; 50370=bitstolow; 51350= oddballsignal; 51370= bitstolow; 52350= oddball, oddballsignal; 52370=bitstolow; 53350=oddball, oddballsignal; 53370=bitstolow; 54350=oddball, oddballsignal; 54370=bitstolow; 55350=oddball, oddballsignal; 55370=bitstolow; 56350= oddball, oddballsignal; 56370=bitstolow; 57350= oddball, oddballsignal; 57370=bitstolow; 58350=oddball, oddballsignal; 58370=bitstolow; 593350=oddball, oddballsignal; 59370=bitstolow; 60350=oddball, oddballsignal; 60370=bitstolow; 61350= oddball, oddballsignal; 61370=bitstolow; 62350= oddball, oddballsignal; 62370=bitstolow; 63350=oddball, oddballsignal; 63370=bitstolow; 64350=oddball, oddballsignal; 64370=bitstolow; 65350=oddball, oddballsignal; 65370=bitstolow; 66350= oddball, oddballsignal; 66370=bitstolow; 67350= oddball, oddballsignal; 67370=bitstolow; 68350=oddball, oddballsignal; 68370=bitstolow; 69350=oddball, oddballsignal; 69370=bitstolow; 70350=oddball, oddballsignal; 70370=bitstolow; 71350= oddballsignal; 71370= bitstolow;72350= oddball, oddballsignal; 72370=bitstolow; 73350=oddball, oddballsignal; 73370=bitstolow; 74350=oddball, oddballsignal; 74370=bitstolow; 75350=oddball, oddballsignal; 75370=bitstolow; 76350= oddball, oddballsignal; 75370=bitstolow; 76350= oddball, oddballsignal; 77370=bitstolow; 78350=oddball, oddballsignal; 78370=bitstolow; 79350=oddball, oddballsignal; 79370=bitstolow; 80350=oddball, oddballsignal; 80370=bitstolow]


/ validresponse = (" ")


/ correctresponse = (" ")


/ trialduration = 500


</trial>



<block oddball>


/ trials = [1 = replace(oddball)]


/ stop = [block.oddball.trialcount > 1]


</block>



<expt oddball>


/ blocks = [1=oddball]


</expt>



*************************************************************************************************


************* GLOBAL SETTINGS AND VARIABLES ******************************************


*************************************************************************************************


<values>


/ lasttrial = ""


/ skipcount = 0


</values>



By Dave - 3/27/2011

/ trialduration = 500 doesn't make sense. You might also want to set /responsetime = 0, otherwise you may not be able to interrupt the experiment while the stimulus presentation sequence is running.

By Yasen - 3/11/2014

Hey Guys, 

I'm about to run an online study where part of the stimuli are video files. The question is - is there a limit on the total size of script and stimuli for online studies? 
Mine total is about 175 MB. Would such size be OK or it will cause problems?

Thank you very much in advance! Any help, comment, advice will be greatly appreciated! :)

Cheers, 

Yasen 
By Dave - 3/11/2014

Yes, there is a limit (approx. 40MB, I believe) and 175MB is well beyond what can be recommended to ensure an acceptable user-experience for your participants. Keep in mind that -- in order to provide proper stimulus / response timing -- all files an Inquisit experiment relies on must be fully downloaded to each and every participant's computer prior to actually starting the experiment. With a 175MB video file, this process will take rather long and may fail for anyone on a slow and/or unreliable internet connection. You should investigate whether you can get the video down to a more reasonable size via re-encoding.

Hope this helps.
By Yasen - 3/11/2014

Thanks a lot, Dave! Although that's actually not-so great news for me...  as I just managed to bring it down to 175... But anyways thanks for the info, I'll figure something out! :)

Great job on answering so many questions so quickly btw! :)) 
By Dave - 3/11/2014

Let me add a couple more thoughts and clarifications (and apologies for the delayed reply, BTW):

- If you have personal webspace available, it is perfectly possible to host your video file(s) there. Suppose you have the file uploaded to http://mydomain.com/myfiles/myvideo.wmv, then the <video> element in your script should be able to fetch that file like so:

<video myvideo>
/ items = ("http://mydomain.com/myfiles/myvideo.wmv")
[...]
</video>

- If need be, the storage limit applicable to files hosted on the millisecond.com server can be lifted. In that case, contact inquisit<at>millisecond.com or support<at>millisecond.com with your account details.

The general caveat mentioned previously remains, though: A slow or unreliable internet connection can cause unacceptable delay or download failure. Perhaps potential participants can be made explicitly aware of this (i.e. have a little patience while stuff is being downloaded) and discouraged from taking part in case their internet access is low-bandwidth or otherwise somewhat unstable.

Lastly, when working with video files on machines not under your control, make sure your files are encoded using a widely available and deployed codec (more exotic ones may not be available on a given participant's computer). WMV should work on virtually all Windows machines out of the box.

Hope this helps.
By Yasen - 3/11/2014

Thanks a million, Dave!! That really helps!! :)
By Yasen - 3/23/2014

Hi Dave, 

Thank again for helping me! 

The guys you referred me to altered the quota limit and I uploaded the videos (122 MB) and ti's all running. However, it doesn't run on all computers I tried it. I have troubles running it on Mac... Say out of approx. 10 computers - 7 run the script and it's all fine, but for 3 of them it crashes - two are with Mac and one with Windows. Any idea why that might be?! 

I'm planning to send email invitations to participants, so if you have some idea why it might not run, I could advise them... something like "please run this task on a computer with Windows operating system only" or "check this or that before you run the task" or something like that... 

Thanks a lot, Dave! :)
By Dave - 3/23/2014

First, I am confused. You posted to the Inquisit 3 forum. Inquisit 3 work on Windows only, i.e. that automatically excludes Macs. Regardless, if you want videos to work reliably across platforms, you ought to make sure you pick a codec that's widely available and compatible. You'll find this covered in the Inquisit 4 documentation topic for the <video> element:

"Note that not all video file containers and codecs are supported on all platforms. To present videos that will work on both Mac and Windows, use the mpg (with mp2 codec) format, or use conditional include elements to select *.wmv versions of your videos on Windows and *.mov versions for Mac."

I cannot speak to the crashes you mention without any further technical details.