I set the resolution to full hd (width=1920, height=1080) on my c920 webcam and used the cv2.CAP_DSHOW API which supports this camera.
However, the fps was very low. The next thing i tried is to autodetect the API by simply writing
camera = cv2.VideoCapture(0, cv2.CAP_ANY)
Now I get very high fps but it is not a 16:9 format anymore, it has some black side bars on the left and right side of the image like in this post: OpenCV capturing imagem with black side bars
Is there are way to:
- Find out which API has been autodetected?
- Find out which format is being used?
- Can I change the format afterwards manually without losing much of the gained performance?
Or do you have a better idea how to handle this problem?
Printing camera says it's still full hd:
(grabbed, frame0) = camera.read()
print(len(frame0[0])) # = 1920
print(len(frame0)) # = 1080
`video.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc(*'MJPG'))` – Björn Apr 09 '20 at 22:12