I am trying to access a Logitech c310 webcam on my beaglebone. It always returns false for any device ID, I am not sure why.
I use the following code.
I found something in documentation which might just help.
cap.read() returns a bool (True/False). If frame is read correctly, it will be True. Sometimes, cap may not have initialized the capture. In that case, the code shows error. You can check whether it is initialized or not by the method cap.isOpened(). If it is True, OK. Otherwise open it using cap.open().
Source: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video