Millisecond Forums

unable to open videos?

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

By evolpsy - 6/23/2008

Hi everyone,



I plan on using inquisit for presenting a series of videos. The videos are in mpeg-2 format. They are in the same folder as the script for the experiment is. Windows media player opens the videos just fine (after instalment of the codec).


I have had a run with 'run the monkey' and it tells me that inquisit is unable to open any of the videofiles.


part of the video script is below.



Any ideas why inquisit won't open the files?



best,



Thomas


--


<video videofriend>


/ erase = true(255, 255, 255)


/ halign = center


/ hposition = 50


/ items = ("A1.mpeg", "A2.mpeg", "A3.mpeg", "A4.mpeg", "A5.mpeg", "A6.mpeg", "A7.mpeg", "A8.mpeg", "A9.mpeg", "A10.mpeg", "A11.mpeg", "A12.mpeg", "A13.mpeg", "A14.mpeg", "A15.mpeg", "A16.mpeg", "A17.mpeg", "A18.mpeg", "A19.mpeg", "A20.mpeg", "A21.mpeg", "A22.mpeg", "A23.mpeg", "A24.mpeg", "A25.mpeg", "A26.mpeg", "A27.mpeg", "A28.mpeg", "A29.mpeg", "A30.mpeg", "A31.mpeg", "A32.mpeg", "A33.mpeg", "A34.mpeg", "A35.mpeg", "A36.mpeg", "A37.mpeg", "A38.mpeg", "A39.mpeg", "A40.mpeg", "A41.mpeg", "A42.mpeg") ) | itemname


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>

By Dave - 6/24/2008

Hi Thomas,

I'm sensing there's something wrong with your definition of the "/ items" attribute in the above syntax.

(1) There's an superfluous closing bracket ")" that you should remove.
(2) The portion stating "| itemname" should also be removed.

Please see if this changes your script's behavior and report back!

~Dave
By evolpsy - 6/24/2008

Thanks for your fast reply!



I had noticed this in the mean time as well. I have removed those, but it still does not work.


I still get the message unable to open "...:/A1.mpeg"



best,



Thomas

By evolpsy - 6/24/2008

ok I think I have got it.



It should be .mpg and not .mpeg. I will test and report back later.



best,



Thomas

By seandr - 6/24/2008

For performance reasons, Inquisit uses DirectShow to present Windows Media video. DirectShow provides the underlying components upon which Windows Media Player is built. Though DirectShow and Windows Media Player are effectively the same thing, for some reason Microsoft decided they would not share codecs. So, you'll need to install the DirectShow codec for the video format you are using.


Fortunately, there is a free codec pack called "K Lite" out there that handles most formats. I don't have the link handy, but if you Google "K Lite Codecs" you should find them.


-Sean

By evolpsy - 6/24/2008

Thanks for all your replies.


It looks like the "monkey" is now happy with the .mpg :). As you might gather I want to use Inquisit to present a series of videostimuli.


But I still get error messages unfortunately.


It tells me


1)


<block videofriend> missing close tag.


<block videounknown> missing close tag.


While in my script there is a closing tag </block> ?


2)


<videofriend2>


/ erase is not a valid attribute


As I gather from the help function /erase is a valid function for video stimuli? (This would erase the video after it played and make sure that the last frame of the video doesn't remain? right?).


As you might gather I am not that experienced with inquisit, so I am sorry if these questions are really obvious... .



Many thanks for all your help,


Thomas



My script is below.


---


<expt>


/ subjects = (1 of 2)


/ preinstructions = (begin1)


/ postinstructions = (end)


/ blocks = [1 = videofriend]


</expt>


<expt>


/ subjects = (2 of 2)


/ preinstructions = (begin1)


/ postinstructions = (end)


/ blocks = [1 = videounknown]


</expt>



<defaults>


/ screencolor = (175, 175, 200)


/ font = ("Arial", -21, 700, 0, 34)


/ txcolor = (0, 0, 0)


/ validkeys = ("E", " ", "I")


/ pretrialpause = 200


/ posttrialpause = 200


</defaults>


******** Block Definitions *******


<block videofriend>


/ preinstructions = [(Instruction)]


/ trials = [1-5 = random(<video videofriend2>)]


</block>


<videofriend2>


/ erase = true(255, 255, 255)


/ halign = center


/ hposition = 50


/ items = ("A1.mpg", "A2.mpg", "A3.mpg", "A4.mpg", "A5.mpg", "A6.mpg", "A7.mpg", "A8.mpg", "A9.mpg", "A10.mpg", "A11.mpg", "A12.mpg", "A13.mpg", "A14.mpg", "A15.mpg", "A16.mpg", "A17.mpg", "A18.mpg", "A19.mpg", "A20.mpg", "A21.mpg", "A22.mpg", "A23.mpg", "A24.mpg", "A25.mpg", "A26.mpg", "A27.mpg", "A28.mpg", "A29.mpg", "A30.mpg", "A31.mpg", "A32.mpg", "A33.mpg", "A34.mpg", "A35.mpg", "A36.mpg", "A37.mpg", "A38.mpg", "A39.mpg", "A40.mpg", "A41.mpg", "A42.mpg")


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>



<block videounknown>


/ preinstructions = [(Instruction)]


/ trials = [1-5 = random(<video videounknown2>)]


</block>


<videounknown2>


/ erase = true(255, 255, 255)


/ halign = center


/ hposition = 50


/ items = ("B1.mpg", "B2.mpg", "B3.mpg", "B4.mpg", "B5.mpg", "B6.mpg", "B7.mpg", "B8.mpg", "B9.mpg", "B10.mpg", "B11.mpg", "B12.mpg", "B13.mpg", "B14.mpg", "B15.mpg", "B16.mpg", "B17.mpg", "B18.mpg", "B19.mpg", "B20.mpg", "B21.mpg", "B22.mpg", "B23.mpg", "B24.mpg", "B25.mpg", "B26.mpg", "B27.mpg", "B28.mpg", "B29.mpg", "B30.mpg", "B31.mpg", "B32.mpg", "B33.mpg", "B34.mpg", "B35.mpg", "B36.mpg", "B37.mpg", "B38.mpg", "B39.mpg", "B40.mpg", "B41.mpg", "B42.mpg")


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>


---

By Dave - 6/24/2008

The videofriend2 element to is missing a proper opening tag (it just says <videofriend2> instead of <video videofriend2>). Same goes for <videounkonwn>. There's also something wrong with the /trials element in your videofriend block. It should probably read / trials = [1-5 = random(videofriend2)]. Those are the mistakes I could make out at a quick glance. Try correcting them and see if that improves your script's behavior.

Best,
~Dave

By evolpsy - 6/25/2008

Thanks for that! The closing tag issue now appears to be sorted.


but after applying your solution I get:



/trials: Could not locate element '<videofriend2'.


/trials: Trial 1 is unassigned.


/trials: Trial 2 is unassigned.


/trials: Trial 3 is unassigned.


/trials: Trial 4 is unassigned.


/trials: Trial 5 is unassigned.


This issue disappears if I put trials = [1-5 = random(video videofriend2)]. but then the closing tags issues reappear.... . 


Any ideas? (The updated script is below).


Many thanks,


best,


 


Thomas


--


<expt>


/ subjects = (1 of 2)


/ preinstructions = (begin1)


/ postinstructions = (end)


/ blocks = [1 = videofriend]


</expt>


<expt>


/ subjects = (2 of 2)


/ preinstructions = (begin1)


/ postinstructions = (end)


/ blocks = [1 = videounknown]


</expt>



<defaults>


/ screencolor = (175, 175, 200)


/ font = ("Arial", -21, 700, 0, 34)


/ txcolor = (0, 0, 0)


/ validkeys = ("E", " ", "I")


/ pretrialpause = 200


/ posttrialpause = 200


</defaults>


******** Block Definitions *******


<block videofriend>


/ preinstructions = [(Instruction)]


/ trials = [1-5 = random(<videofriend2>)]


</block>



<video videofriend2>


/ erase = true(255, 255, 255)


/ halign = center


/ hposition = 50


/ items = ("A1.mpg", "A2.mpg", "A3.mpg", "A4.mpg", "A5.mpg", "A6.mpg", "A7.mpg", "A8.mpg", "A9.mpg", "A10.mpg", "A11.mpg", "A12.mpg", "A13.mpg", "A14.mpg", "A15.mpg", "A16.mpg", "A17.mpg", "A18.mpg", "A19.mpg", "A20.mpg", "A21.mpg", "A22.mpg", "A23.mpg", "A24.mpg", "A25.mpg", "A26.mpg", "A27.mpg", "A28.mpg", "A29.mpg", "A30.mpg", "A31.mpg", "A32.mpg", "A33.mpg", "A34.mpg", "A35.mpg", "A36.mpg", "A37.mpg", "A38.mpg", "A39.mpg", "A40.mpg", "A41.mpg", "A42.mpg")


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>


</block>



<block videounknown>


/ preinstructions = [(Instruction)]


/ trials = [1-5 = random(<videounknown2>)]


</block>


<video videounknown2>


/ erase = true(255, 255, 255)


/ halign = center


/ hposition = 50


/ items = ("B1.mpg", "B2.mpg", "B3.mpg", "B4.mpg", "B5.mpg", "B6.mpg", "B7.mpg", "B8.mpg", "B9.mpg", "B10.mpg", "B11.mpg", "B12.mpg", "B13.mpg", "B14.mpg", "B15.mpg", "B16.mpg", "B17.mpg", "B18.mpg", "B19.mpg", "B20.mpg", "B21.mpg", "B22.mpg", "B23.mpg", "B24.mpg", "B25.mpg", "B26.mpg", "B27.mpg", "B28.mpg", "B29.mpg", "B30.mpg", "B31.mpg", "B32.mpg", "B33.mpg", "B34.mpg", "B35.mpg", "B36.mpg", "B37.mpg", "B38.mpg", "B39.mpg", "B40.mpg", "B41.mpg", "B42.mpg")


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>


</block>


<instruct>


/ font = ("Courier New", -15, 700, 0, 49)


/ nextkey = (" ")


/ nextlabel = "Press space bar to proceed"


/ lastlabel = "Press space bar to proceed"


/ prevkey = ("E")


</instruct>



<page begin1>


^^^


Thank you for taking part in this experiment^


you will see some videos and then^


answer some questions


^^^


</page>


<page instruction>


^^^^


You will be seeing some videos now.^^^


^


</page>

By Dave - 6/25/2008

Okay, the definition of the /trial attribute in your blocks is still messed up (see my earlier post). But your basic problem is that you're trying to run trials from your blocks that are not yet defined anywhere in the script. You need to add trials to run the video stimuli. For example:

<trial videofriend>
/ stimulusframes = [1 = videofriend]
/ correctresponse = ("E")
/ validresponse = (anyresponse)
</trial>

(I'm not sure whether the trial syntax is complete or additional attributes need to be defined. Can't check that right now.)

And so on for the other categories of video stimuli...

~Dave

P.S.: To make things clearer, here's the basic design logic / hierarchy in Inquisit:
Experiments <expt exptname> run  groups of blocks <block blockname>
A block <block blockname> runs a sequence of trials <trial trialname>
A trial <trial trialname> presents one or several stimuli (text, video, sound, etc.)

Each of these elements must be defined in your script.


By evolpsy - 6/26/2008

Thanks for your great help!


It is working now!


The only issue now is that it freezes after it played the first video? I thought that a /replace command  in the trial section would make sure the next trial starts? How do I ensure that a video starts automatically (after a brief pause) when one has finished? (Ideally the participant shouldn't have to do anything just sit there and watch).


Thanks for all your great help.


best,



Thomas



------------


<expt>


/ subjects = (1 of 2)


/ preinstructions = (begin1)


/ postinstructions = (end)


/ blocks = [1 = videofriend]


</expt>


<expt>


/ subjects = (2 of 2)


/ preinstructions = (begin1)


/ postinstructions = (end)


/ blocks = [1 = videounknown]


</expt>



<defaults>


/ screencolor = (175, 175, 200)


/ font = ("Arial", -21, 700, 0, 34)


/ txcolor = (0, 0, 0)


/ validkeys = ("E", " ", "I")


/ pretrialpause = 200


/ posttrialpause = 200


</defaults>


******** Block Definitions *******


<block videofriend>


/ preinstructions = [(Instruction)]


/ trials = [1-5 = random(videofriendtrial)]


</block>



<trial videofriendtrial>


/ pretrialpause = 200


/ stimulusframes = [1 = videofriend2]


/ validresponse = (noresponse)


/ timeout = (replace)


</trial>


<video videofriend2>


/ halign = center


/ hposition = 50


/ items = ("A1.mpg", "A2.mpg", "A3.mpg", "A4.mpg", "A5.mpg", "A6.mpg", "A7.mpg", "A8.mpg", "A9.mpg", "A10.mpg", "A11.mpg", "A12.mpg", "A13.mpg", "A14.mpg", "A15.mpg", "A16.mpg", "A17.mpg", "A18.mpg", "A19.mpg", "A20.mpg", "A21.mpg", "A22.mpg", "A23.mpg", "A24.mpg", "A25.mpg", "A26.mpg", "A27.mpg", "A28.mpg", "A29.mpg", "A30.mpg", "A31.mpg", "A32.mpg", "A33.mpg", "A34.mpg", "A35.mpg", "A36.mpg", "A37.mpg", "A38.mpg", "A39.mpg", "A40.mpg", "A41.mpg", "A42.mpg")


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>


</block>





<block videounknown>


/ preinstructions = [(Instruction)]


/ trials = [1-5 = random(videounknowntrial)]


</block>


<video videounknown2>


/ halign = center


/ hposition = 50


/ items = ("B1.mpg", "B2.mpg", "B3.mpg", "B4.mpg", "B5.mpg", "B6.mpg", "B7.mpg", "B8.mpg", "B9.mpg", "B10.mpg", "B11.mpg", "B12.mpg", "B13.mpg", "B14.mpg", "B15.mpg", "B16.mpg", "B17.mpg", "B18.mpg", "B19.mpg", "B20.mpg", "B21.mpg", "B22.mpg", "B23.mpg", "B24.mpg", "B25.mpg", "B26.mpg", "B27.mpg", "B28.mpg", "B29.mpg", "B30.mpg", "B31.mpg", "B32.mpg", "B33.mpg", "B34.mpg", "B35.mpg", "B36.mpg", "B37.mpg", "B38.mpg", "B39.mpg", "B40.mpg", "B41.mpg", "B42.mpg")


/ playthrough = false


/ position = (50, 50)


/ select = noreplace


/ valign = center


/ vposition = 50


</video>


</block>


<trial videounknowntrial>


/ pretrialpause = 200


/ stimulusframes = [1 = videofriend2]


/ validresponse = (noresponse)


/ timeout = (replace)


</trial>


By Dave - 6/27/2008

Hm, I'm a bit confused that you obviously don't want subjects to respond to any of your videos. So, let's see. If you use the /validresponse = (noresponse) setting in a trial you'll also have to define a proper timeout for said trial. Again, I'm not sure what you're trying to accomplish by setting /timeout = (replace). I suspect, you're mixing things up. The /replace setting can be used for selecting stimuli, not for defining timeouts. So, what to do now?

If all of your videos have the same length (say, 20 seconds), you could set a generic timeout in your trial (i.e. /timeout = 20000). If your videos vary considerably in length, you could define a trial for each single video (you'd have as many differently named trials in your script as you have videos) with a timeout specifically matched for the video it's presenting. But the easiest way in my opinion would be to actually have subjects respond to the video by having them click an "Advance to next video" button (or so) after the current video has finished, because this would require only minor changes to the existing script.

Does that help?
~Dave
By evolpsy - 6/27/2008

Yes this does help!



Well we don't want them respond as the structure of the experiment is that they first see a (randomised) series of videos and then perform a behavioural task (tasting, touching or smelling something). Ideally we don't want them to do anything except sit there and watch the series : ).



The videos are all close to 10s but not exact (though it shouldn't be much more than 10s), so I think I will go for the timeout = 10100 option. I was just wondering if there was any option where the next video would start without having to specify the (exact) length of the trials. (This would be less work than specifying the exact timeout for 84 videos). I was hoping that replace might be able to dot the job. Anyway, now I know!



Many thanks for your helpful comments,



Thomas

By Dave - 6/27/2008

Glad I could help out. Good luck with your research!
~Dave