Exit gracefully when running out of video frames

This commit is contained in:
kris 2019-06-19 21:54:07 +01:00
parent 38663088ef
commit 5dcbca4aae

View File

@ -53,7 +53,11 @@ class Movie:
for au in self.audio.audio_stream(): for au in self.audio.audio_stream():
self.ticks += 1 self.ticks += 1
if self.video.tick(self.ticks): if self.video.tick(self.ticks):
main, aux = next(video_frames) try:
main, aux = next(video_frames)
except StopIteration:
break
if ((self.video.frame_number - 1) % self.every_n_video_frames if ((self.video.frame_number - 1) % self.every_n_video_frames
== 0): == 0):
print("Starting frame %d" % self.video.frame_number) print("Starting frame %d" % self.video.frame_number)