cvlib: Could not read frame
I am trying to run object_detection_webcam.py.
[ WARN:0] videoio(MSMF): OnReadSample() is called with error status: -1072875772 [ WARN:0] videoio(MSMF): async ReadSample() call is failed with error status: -1072875772 [ WARN:1] videoio(MSMF): can't grab frame. Error: -1072875772 Could not read frame
It is unable to read the frame. Could you help me understand what went wrong?
Thanks.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 31 (13 by maintainers)
Hello @shrybht ,
object_detection.py accepts an input image to apply object detection. Usage is mentioned at the top of the file as comment.
Regarding object_detection_webcam.py, I guess the issue is in accessing webcam at platform level. Are you working with Windows ?
Have a look at this issue on OpenCV forum.
Try replacing
cv2.VideoCapture(0)
withcv2.VideoCapture(cv2.CAP_DSHOW)
. Let me know if it works.Where can I find .cvlib folder in windows?
Thank you for the update Arun. It’s working.
It works! Thank you so much.