From 1947b6a9c1952c7787139a53bc90c15a96ea23ed Mon Sep 17 00:00:00 2001 From: tapani-hopkins Date: Thu, 11 Nov 2021 09:04:34 +0200 Subject: [PATCH] fix last frame being None When FileVideoStream reaches the end of the file, it takes one more frame (which is NoneType) and tries to transform and add it to the queue. This has also been noted in issue #251 . This causes an error if the transform expects a valid frame, or if the main script does not expect the last frame in the Queue to be NoneType. --- imutils/video/filevideostream.py | 1 + 1 file changed, 1 insertion(+) diff --git a/imutils/video/filevideostream.py b/imutils/video/filevideostream.py index f173eb5..ba447df 100644 --- a/imutils/video/filevideostream.py +++ b/imutils/video/filevideostream.py @@ -50,6 +50,7 @@ def update(self): # reached the end of the video file if not grabbed: self.stopped = True + break # if there are transforms to be done, might as well # do them on producer thread before handing back to