.set() is not working for brightness and exposure on Macbook
Hi, I m using opencv 4.1.2 and Macbook to set camera properties but continously getting False in response for brightness and exposure while height and width are fine. Macbook OpenCV 4.1.2 Logitech Brio 4K
import cv2
import time
cap = cv2.VideoCapture(1,cv2.CAP_AVFOUNDATION)
r=cap.set(3,1920)
print(r)
r=cap.set(4,1080)
print(r)
time.sleep(2)
r1=cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0)
r=cap.set(cv2.CAP_PROP_EXPOSURE, -7)
print(r1)
print(r)
r=cap.set(cv2.CAP_PROP_BRIGHTNESS,1.0)
print(r)
print(cap.get(cv2.CAP_PROP_BRIGHTNESS))
ret, img = cap.read()
img1="1.jpg"
cv2.imwrite(img1, img)
#cv2.imshow(img)
cap.release()
Response
True
True
False
False
False
0.0
there is no guarantee ever, that the set() / get() functions will work, given your combination of hw / os / driver / video backend.
then how to resolve this issue? I have both option either using cli or by using python3 and opencv
hw tested using OBS working fine pictures are taken but setting are taking any effect when using with python3. Even resoluton is having effect using python3 and open cv2 as mention above
if i read it correctly, the avfoundation wrappers only seem to support this for IOS