0

I am trying to follow the MovieStim3 pausing example as outlined here:

MoviePause.py

I am using the same code as this example, except I am using my own movie file.

print('orig movie size=' + str(mov.size))
print('duration=%.2fs' % mov.duration)
globalClock = core.Clock()

# play 100 frames normally
for frameN in range(100):
    mov.draw()
    win.flip()

# pause stops sound and prevents frame from advancing
mov.pause()
for frameN in range(100):
    mov.draw()
    win.flip()

# frame advance and audio continue
mov.play()
while globalClock.getTime() < (mov.duration + 1.0):
    mov.draw()
    win.flip()

win.close()
core.quit()

The issue I'm having is that the video pauses fine, but when it starts playing again, the video and audio are not synchronized anymore. It appears as though the audio pauses and restarts fine, but the video shows a burst of fast frames before going at the proper speed. Its almost as if the video is trying to 'catch up' to a timer, but I haven't been able to figure it out.

1 Answers1

0

Sounds like a player issue, some incompatibility between moviepy and your movie format. Try to convert the movie file to some other format such as h264 with ffmpeg and try again.

Keji Li
  • 62
  • 1
  • 7