Movie component not working in a loop with condition files

Whenever I try to run video stimuli in a loop from a condition file, I get either “UnboundLocalError: local variable ‘tThisFlipGlobal’ referenced before assignment” or MovieFileNotFoundError. I’m 100% sure the path and file attributes are correct - I’ve gone through many many threads to try to solve this.

I’m not sure what more I could do - image loops from condition files work just fine so without getting into code (I’m not familiar with PsychoPy libraries) I simply don’t see the reason for this issue.

OS: Win11
PsychoPy version: 2024.2.4 Py 3.12
Standard Standalone Installation
Only locally run experiment

Pleaser could you show a screenshot of your video component?

When do you get one error and when do you get the other?

Sure, here’s everything that’s relevant. I’ve also been getting [Alert 4705: Column name ‘Stim’ in conditions file already exists as a variable in this experiment (user).] seemingly for no reason.

Another notification I’ve been getting is [Column name ‘Stim’ in conditions file already exists as a variable in this experiment (user).].

My stimuli are 1s long but regardless of whether I force their duration or not, the last frame remains displayed for 1-2s after. Timings are also way off but I’ll deal with that later on by preloading everything.

Whenever I run the experiment with the stimulus display time set to 1s, nothing gets displayed and I get [Experiment ended with exit code 3489660927 [pid:22452]].

My description is a bit different here because I’m currently trying to design the procedure on a PC (earlier it was from a laptop).

I would remove the stop condition from your movie component, but tick “force end of routine” so it ends when the movie ends. Are your movie files 1 second long?

Also – maybe change the start time to 1 second. You could add a static period and load the movie file during that instead of each repeat.

Yes, the movie files are all 1s long - for some reason they’re still shown as much longer in the routine view as you can see on the screenshot.

And yes, there will be a 2 - 3.5s (randomized) static period before every movie which is when the stimuli will be loaded.

Hello @Oskar_Zolcinski

The duration shown in the Builder does not represent the actual duration. It just shows that it is a component for which the duration is unknown. Enter a value in expected duration.

Best wishes Jens

As an update to this thread. I have recently been getting the error UnboundLocalError: local variable ‘tThisFlipGlobal’ referenced before assignment when the first routine in my experiment ends too soon.