Video Capture Resolution Issue on Windows
Hi,
I've been trying to just do a simple Video capture feed with open cv but i have a problem with the resolution of the feed. The video feed defaults into 640 x 480 resolution but I know the camera can achieve a higher resolution. I tested on the windows camera app and i was able to get 1920 x 1080 resolution. I have already tried setting the height and width of the video capture through the use of
cap.set(CV_CAP_PROP_FRAME_WIDTH,1920);
cap.set(CV_CAP_PROP_FRAME_HEIGHT,1080);
This results in the video capture having that resolution but the the sides are filled with black pixels and the image does not look like the appropriate resolution.
I am programming this in a windows environment on Visual Studio 2017. The camera I'm using is the Logitech HD Webcam C615. I'm using Open CV 3.4.2
Cheers
most cameras have a better resolution for still images, and a worse one for streaming video.
The specification of the camera says it can achieve HD video calls at 720p. I have also been able to use the camera at 1080p video stream on LabView. I don't think its an issue with the camera
if you have it, try the MSMF backend:
cap.open(0,CAP_MSMF);
or dshow:cap.open(0,CAP_DSHOW);
(maybe it's trying the outdated vfw one first)
if you have recent 3.4.2, you can also set an env var to debug it:
(then run your program again, it will show you, in which order the backends are tried, and what was used to open your cam)
I have tried both APIs, the only one that gives me the video capture is dshow but it is at 640 x 480 but this was tested without setting the env var and the video feed was opened individually to see if the program crashed or not. I can try again tomorrow as my setup is at the university.
Hey thanks for the help I managed to get it working with your advice. I tried both back end APIs. I was able to get a video capture through both of them but they both were still defaulted to 640 x 480 resolution. I then manually tried setting the resolution again through
cap.set(CV_CAP_PROP_FRAME_WIDTH,1280);
cap.set(CV_CAP_PROP_FRAME_HEIGHT,720);
With MSMF the results were the same but with dshow i was able to get the proper video feed.
Thanks for your help.