-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileVideoStream: do not call transform when stopping #119
Conversation
@Ed-Swarthout-NXP
This error simply means that the path to video file is wrong or missing, not related to do not call transform when stopping, as you suspected . |
I see the video play before the error occurs at the end - so the path to the video file is correct. |
Ok, So you're experiencing this problem when the video ends. So you can easily handle that with the code as below:
thereby we can now check for File End and then exit safely. Related Merged PR is here #102. Try this, There is no need for this PR. |
But self.tranform() is called before read() returns. |
Nope, before
and After breaking from the main loop(as suggested in my previous comment), you call
Since VideoStream thread will be released and closed already, there will be simply no threading error! |
The loop is indeed ended when But the real problem here is that the This is solved by adding a simple In case of doubt, be sure to check the commit itself and the explanation in #137. |
Fixes: read_frames_fast.py -v /home/swarthout/packages/sw/opencv/opencv_extra/testdata/highgui/video/big_buck_bunny.wmv [INFO] starting video file thread... Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.6/dist-packages/imutils/video/filevideostream.py", line 67, in update frame = self.transform(frame) File "read_frames_fast.py", line 21, in filterFrame frame = imutils.resize(frame, width=450) File "/usr/local/lib/python3.6/dist-packages/imutils/convenience.py", line 69, in resize (h, w) = image.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape' [INFO] elasped time: 0.31 [INFO] approx. FPS: 402.98 Signed-off-by: Ed Swarthout <Ed.Swarthout@nxp.com>
Despite the comments to the contrary, this issue still exists and somebody else had to debug and generate their own pull request. See #137 |
Fixes:
read_frames_fast.py -v /home/swarthout/packages/sw/opencv/opencv_extra/testdata/highgui/video/big_buck_bunny.wmv
[INFO] starting video file thread...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/dist-packages/imutils/video/filevideostream.py", line 67, in update
frame = self.transform(frame)
File "read_frames_fast.py", line 21, in filterFrame
frame = imutils.resize(frame, width=450)
File "/usr/local/lib/python3.6/dist-packages/imutils/convenience.py", line 69, in resize
(h, w) = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
[INFO] elasped time: 0.31
[INFO] approx. FPS: 402.98
Signed-off-by: Ed Swarthout Ed.Swarthout@nxp.com