Ask Your Question

Camera properties dialog (DirectShow) no longer opens with cv2.CAP_PROP_SETTINGS

asked 2019-08-20 16:41:38 -0500

cv2 gravatar image

This code in Python used to bring up the DirectShow properties dialog for setting the exposure, brightness, etc. for a camera but at some point (not sure how long ago), it must have stopped working as it doesn't work for me anymore, even trying across different computers and different cameras:

cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_SETTINGS, 1)

Here's the window I'm referencing

Python 3.6, OpenCV 3.4

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-08-21 02:19:38 -0500

LBerger gravatar image

updated 2019-08-21 02:20:30 -0500

When you use VideoCapture(0) default api is used. cv2.CAP_PROP_SETTINGS is only for CAP_DSHOW API. try to use VideoCapture(index+cv2.CAP_DSHOW)

edit flag offensive delete link more


So basically what happened is that your source systems has another video capturing backend installed which is grabbed before DSHOW in the OpenCV pipeline. The suggestion of @LBerger allows to explicitly select an interface.

StevenPuttemans gravatar imageStevenPuttemans ( 2019-08-21 05:53:47 -0500 )edit

That did the trick - super helpful - thanks

cv2 gravatar imagecv2 ( 2019-08-21 11:19:42 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-20 16:41:38 -0500

Seen: 52 times

Last updated: Aug 21