Psychopy movies Crashes with No Warning, Even in Debug Mode

Hello everyone,

I have an issue that happens in an experiment I have stored currently on- GitHub - Snirbarz/gambling_coin: coin gambling task

The file is called “gambling_Blocked.py”

I am trying to run .avi files 24 times per block using VlcMovieStim. The movies are 3 seconds long and there are 58 of them.
coin_flip = flip_stim(coin_side_1[stim_coin[i]],coin_side_2[stim_coin[i]],outcome[j])
coin_flip.draw()
win0.flip()
while not coin_flip.isFinished:
coin_flip.draw()
win0.flip()
coin_flip.stop()
coin_flip._closeMedia() # I added this to try to control for RAM issues. However, the crashes presist

This is the function flip_stim():

def flip_stim(image_type_1,image_type_2,side):
‘’’
We are preparing our Stimulus
text_type == 0, “frog”
text_type == 1, “face”
text_type == 2, “sign”
text_type == 3, “tomato”
text_type == 4, “hand”
text_type == 5, “pond”
text_type == 6, “wrench”
text_type == 7, “house”
‘’’
image_stim_name = [“01”,“02”,“03”,“04”,“05”,“06”,“07”,“08”]
if side == 0: # is it the left image
outcome_image = image_stim_name[image_type_1]
else: # is it the right image
outcome_image = image_stim_name[image_type_2]
coin_flip = visual.VlcMovieStim(win = win0,
filename = “data/coin”+image_stim_name[image_type_1]+image_stim_name[image_type_2]+outcome_image+“.avi”,
units = “pix”,
pos = (0,0),
autoStart=True)
return coin_flip

in the fourth block (trial number is inconsistent) the experiment crashes. without any errors or warning. Even in debug mode I can’t see any errors.

When I tries to comment away the movie display lines, the experiment did not crash and I managed to move further into the next block.

I am at a loss, because I don’t think that changing the VlcMovieStim into a different function would help.

You help will be much appreciated,
Snir