Logfile movie stimuli duration

PsychoPy version: latest

Hi,

When looking at the duration of my movie stimuli in the log file, I see two lines for the end of the movie but do not understand the difference between them. My movie stim is called Clip_1, for instance.

I understand the start is marked as
Clip_1: autoDraw = True

but for the end of the clip, there is either
Set Clip_1 finished
or
Clip_1: autoDraw = False

Which one should I take to mark the end of my movie stimulus? Both indicate similar values, maybe with the equivalence of a frames’ difference but I’m not sure.

Thank you very much!
Alice

Hi Alice,

Good question, I’m not 100% sure but I think your logic makes sense - a movie would be marked as finished and then “undrawn” on the window flip afterwards.

The JS underlying the playing of a movie looks something like:

    if (t >= 0.0 && movie.status === PsychoJS.Status.NOT_STARTED) {
      // keep track of start time/frame for later
      movie.tStart = t;  // (not accounting for frame time here)
      movie.frameNStart = frameN;  // exact frame index
      
      movie.setAutoDraw(true);
      movie.play();
    }

    frameRemains = 0.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75;  // most of one frame period left
    if (movie.status === PsychoJS.Status.STARTED && t >= frameRemains) {
      movie.setAutoDraw(false);
    }

So it would be accurate that the call to autoDraw = False would be shortly after the movie finished I think

Becca

Hi Becca,

Thanks a lot for your help and time! Yes, exactly. I looked into it a bit more and with the help of a colleague managed to determine that there is indeed a small delay between the first and second commands, which is explained by the time it takes to load the next routine. Using a sleep function of varying duration, we were able to see that this translates as the last clip frame being displayed for a little bit longer (writing this here in case anyone has the same doubt).

Thanks again for helping to confirm this!
Best,
Alice