Ask Your Question

Why does VideoCapture(1) take so long?

asked 2019-07-12 10:53:21 -0500

It seems like it takes forever for my external webcam to actually take the picture. As soon as the picture is taken, it works. When I set it to VideoCapture(0), it works much faster but I need to use my external webcam instead so I have to set it to VideoCapture(1). Does anyone know how to speed up this process? The rest of my code finishes instantly after the picture is finally taken with the external webcam.

edit retag flag offensive close merge delete


Why was this placed on the moderation queue?

robcatinello gravatar imagerobcatinello ( 2019-07-12 10:53:51 -0500 )edit

all new posts are moderated, due to a lot of spam, don't worry.

berak gravatar imageberak ( 2019-07-12 11:17:55 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2019-07-16 08:48:40 -0500

Ok so it took me a while but the problem was solved by switching the API. I changed the line of code:

video_capture = cv2.VideoCapture(1) to

video_capture = cv2.VideoCapture(1, cv2.CAP_DSHOW)

by adding this, it now works instantly, removing the delay which was present before.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-07-12 10:53:21 -0500

Seen: 269 times

Last updated: Jul 12 '19