Ask Your Question
0

Why does VideoCapture(1) take so long?

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

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

Comments

Why was this placed on the moderation queue?

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

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

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

1 answer

Sort by ยป oldest newest most voted
0

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

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

Question Tools

1 follower

Stats

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

Seen: 20,214 times

Last updated: Jul 12 '19