cvlib: Could not read frame

Hi @arunponnusamy

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)

Most upvoted comments

Hello @shrybht ,

object_detection.py accepts an input image to apply object detection. Usage is mentioned at the top of the file as comment.

# object detection example
# usage: python object_detection.py <input_image> 

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) with cv2.VideoCapture(cv2.CAP_DSHOW). Let me know if it works.

Hello @shrybht and @bogdan245 , I have fixed an issue in the config file. I think now it should work as expected. Delete .cvlib folder in the home directory(~) and try now. Let me know if you still face issue.

Where can I find .cvlib folder in windows?

Thank you for the update Arun. It’s working.

now if i

It works! Thank you so much.