I have a webcam that is capable of 1080p 30fps which I have confirmed by using VirtualDub to preview and save a video from the webcam itself.
For some reason OpenCV will only give me around 4FPS, the CPU isn't maxing out any of the cores so I can't see why? (This is without actually outputting the feed by the way, just fetching the frames).
Does anyone with experience of OpenCV know why? Could it be that OpenCV is not using DirectShow to read from the webcam (assuming DirectShow is what you need for 30fps/1080p - i believe that's what virtualdub uses). Could the fact that OpenCV reads the image into its on proprietary datatype Mat
be the bottleneck?
My camera is the Microsoft LifeCam Studio and my OS is Windows 7 with Visual Studios 2010.
Does anyone have any ideas?
30 FPS is achieved by capturing compressed video (most likely JPEG). I my so happen that OpenCV is switching to capture raw video, such as RGB, in which case the effective FPS is limited by USB bandwidth. 4 FPS is about the amount of data USB can push through in 1920x2080 24-bit RGB (25 MB/s).
The solution is to ensure that capture format (media type in DirectShow terms) is compressed video, with post-decompression in software.