Onset and offset timestamps for videos

Hi @miguel_santin

Thanks very much for your much appreciated response! I tried to use the timestamps but did not see the corresponding times… maybe I used it wrong or am not looking for the resulting stamps in the right place? My movie stimuli is called Clip_0 and my routine is called block_0, I used the routine clock rather than the global clock since it is more relevant for me.

logged = 0
Each Frame
if logged == 0:
print('TrialStart: ',block_0Clock.getTime())
logged = 1
elif Clip_0.status == PLAYING and logged == 1:
print('Start: ', int(block_0Clock.getTime()))
logged = 2
elif Clip_0.status == STOPPED and logged == 2:
print('Stop: ', int(block_0Clock.getTime()))
logged = 3

In my experiment I have RTs during the movie stimuli, so it’s important that I know if the movie the participants see is in fact longer than the actual movie length so that I can adjust RTs, I understand this can sometimes happen with dropped frames etc…

About myVideo.getCurrentFrameTime() can this be used to save the start/stop time? I tried it as shown below but was once again unsuccessful as I get the error: ‘Clip_0_Start’ is not defined…

if Clip_0.status==PLAYING:
    Clip_0_Start = Clip_0.getCurrentFrameTime()
thisExp.addData("Clip_0_Start",Clip_0_Start);

if Clip_0.status==STOPPED:
    Clip_0_Stop = Clip_0.getCurrentFrameTime()
thisExp.addData("Clip_0_Stop",Clip_0_Stop);

Thanks again for your valuable help,
Alice