Opencv video capture

opencv unable to capture video frames, always returns false.
code is 100% correct, webcam also working fine.

Share your code after saving it on cb.lk/ide

code written - cb.lk/ide

code - https://ide.codingblocks.com/s/178556

Use
cap = cv2.VideoCapture(0)
VideoCapture takes index of the camera from where to take input, generally it comes into roll play when we are having multiple cameras. So to use your laptop’s webcam you need to use 0 index only.

Hope this cleared your doubt. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.