replacenot crashing experiment


Author
Message
swifty_the_fox
swifty_the_fox
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 10, Visits: 84
Hello,

Seems that the /select = replacenot command is crashing the experiment.

I have a single trial, before the start of an experiment, that does nothing but display a video.

The video's are looped gifs turned into mpg (to work on both mac and windows), so I have tried the loop function, but it loops endlessly and passed the 60 second timeout, regardless of using timeout (which is probably the main issue).

I would like to have a single video from the video item's list displayed, but the video is too short for what I am looking for (15 seconds, when I need 60). Instead of taking the video and cut/pasting it x4 in some movie editor (I was worried about file size here), I was going to just display the same video four times using: / stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high].

Using replacenot, I believe I can have it pick the initial video that it selected, then have it replayed to reach 60 second. But this crashes the experiment when I use it.

I'm probably making this much more difficult than it needs to be...

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

<trial displayvideo>
/ beginresponsetime = [0]
/ stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high]
/ timeout = 60000
</trial>
Dave
Dave
Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)
Group: Administrators
Posts: 11K, Visits: 77K
swifty_the_fox - 12/9/2021
Hello,

Seems that the /select = replacenot command is crashing the experiment.

I have a single trial, before the start of an experiment, that does nothing but display a video.

The video's are looped gifs turned into mpg (to work on both mac and windows), so I have tried the loop function, but it loops endlessly and passed the 60 second timeout, regardless of using timeout (which is probably the main issue).

I would like to have a single video from the video item's list displayed, but the video is too short for what I am looking for (15 seconds, when I need 60). Instead of taking the video and cut/pasting it x4 in some movie editor (I was worried about file size here), I was going to just display the same video four times using: / stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high].

Using replacenot, I believe I can have it pick the initial video that it selected, then have it replayed to reach 60 second. But this crashes the experiment when I use it.

I'm probably making this much more difficult than it needs to be...

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

<trial displayvideo>
/ beginresponsetime = [0]
/ stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high]
/ timeout = 60000
</trial>

It's crashing because with

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

you have made a circular reference. You've instructed <video high> to not select the item selected by <video high>, which of course cannot possibly work.

Dave
Dave
Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)
Group: Administrators
Posts: 11K, Visits: 77K
Dave - 12/9/2021
swifty_the_fox - 12/9/2021
Hello,

Seems that the /select = replacenot command is crashing the experiment.

I have a single trial, before the start of an experiment, that does nothing but display a video.

The video's are looped gifs turned into mpg (to work on both mac and windows), so I have tried the loop function, but it loops endlessly and passed the 60 second timeout, regardless of using timeout (which is probably the main issue).

I would like to have a single video from the video item's list displayed, but the video is too short for what I am looking for (15 seconds, when I need 60). Instead of taking the video and cut/pasting it x4 in some movie editor (I was worried about file size here), I was going to just display the same video four times using: / stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high].

Using replacenot, I believe I can have it pick the initial video that it selected, then have it replayed to reach 60 second. But this crashes the experiment when I use it.

I'm probably making this much more difficult than it needs to be...

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

<trial displayvideo>
/ beginresponsetime = [0]
/ stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high]
/ timeout = 60000
</trial>

It's crashing because with

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

you have made a circular reference. You've instructed <video high> to not select the item selected by <video high>, which of course cannot possibly work.

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = false
/ loop = true
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

with

<trial displayvideo>
/ stimulustimes = [0 = high]
/ validresponse = (0)
/ trialduration = 60000
</trial>

should be all you need.
swifty_the_fox
swifty_the_fox
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 10, Visits: 84
Dave - 12/9/2021
swifty_the_fox - 12/9/2021
Hello,

Seems that the /select = replacenot command is crashing the experiment.

I have a single trial, before the start of an experiment, that does nothing but display a video.

The video's are looped gifs turned into mpg (to work on both mac and windows), so I have tried the loop function, but it loops endlessly and passed the 60 second timeout, regardless of using timeout (which is probably the main issue).

I would like to have a single video from the video item's list displayed, but the video is too short for what I am looking for (15 seconds, when I need 60). Instead of taking the video and cut/pasting it x4 in some movie editor (I was worried about file size here), I was going to just display the same video four times using: / stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high].

Using replacenot, I believe I can have it pick the initial video that it selected, then have it replayed to reach 60 second. But this crashes the experiment when I use it.

I'm probably making this much more difficult than it needs to be...

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

<trial displayvideo>
/ beginresponsetime = [0]
/ stimulustimes = [0 = high; 15000 = high; 30000 = high; 45000 = high]
/ timeout = 60000
</trial>

It's crashing because with

<video high>
/ items = ("video1.mpg", "video2.mpg", "video3.mpg", "video4.mpg")
/ playthrough = true
/ select = replacenot(high)
/ size = (parameters.picSize, parameters.picSize)
/ position = (40%, 50%)
</video>

you have made a circular reference. You've instructed <video high> to not select the item selected by <video high>, which of course cannot possibly work.

Thank you for your reply!

Interesting, it does not crash when I use noreplacenot. Shouldn't that also cause it to crash?
swifty_the_fox
swifty_the_fox
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 10, Visits: 84
The suggested code worked :) Thank you.

Was the loop not ending because I had playthrough = true?
Dave
Dave
Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)
Group: Administrators
Posts: 11K, Visits: 77K
swifty_the_fox - 12/9/2021
The suggested code worked :) Thank you.

Was the loop not ending because I had playthrough = true?

> Was the loop not ending because I had playthrough = true?

I don't have the videos nor the exact code you used when you observed things going past the timeout, so I cannot really say. /playthrough=true forces the video to play to completion, regardless of what the timeout or trialduration is, i.e. you can do something like

<video examplevideo>
/ items = ("20_seconds_of_cute_cats.mp4")
/ playthrough = true
</video>

<trial exampletrial>
/ stimulusframes = [1=examplevideo]
/ timeout = 100
</trial>

and the trial will only end once the video is over, not after 100 milliseconds. This is by design. So, in your case, my guess is that the videos are actually a little shorter than 15 seconds and a 5th loop had already begun shortly before the 60 second timeout lapsed. That 5th loop then would have been completed due to the playthrough=true setting, causing the trial to go beyond the set timeout.

One final note: MPG is not the best format choice these days, it's fairly dated by now. I'd recommend going with H.264 encoded MP4s for all platforms.

Edited Last Month by Dave
swifty_the_fox
swifty_the_fox
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 10, Visits: 84
Dave - 12/9/2021
swifty_the_fox - 12/9/2021
The suggested code worked :) Thank you.

Was the loop not ending because I had playthrough = true?

> Was the loop not ending because I had playthrough = true?

I don't have the videos nor the exact code you used when you observed things going past the timeout, so I cannot really say. /playthrough=true forces the video to play to completion, regardless of what the timeout or trialduration is, i.e. you can do something like

<video examplevideo>
/ items = ("20_seconds_of_cute_cats.mp4")
/ playthrough = true
</video>

<trial exampletrial>
/ stimulusframes = [1=examplevideo]
/ timeout = 100
</trial>

and the trial will only end once the video is over, not after 100 milliseconds. This is by design. So, in your case, my guess is that the videos are actually a little shorter than 15 seconds and a 5th loop had already begun shortly before the 60 second timeout lapsed. That 5th loop then would have been completed due to the playthrough=true setting, causing the trial to go beyond the set timeout.

One final note: MPG is not the best format choice these days, it's fairly dated by now. I'd recommend going with H.264 encoded MP4s for all platforms.

Ahhh, that makes sense. Thank you!

And also thank you for the format suggestion :)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search