Linux下OpenCV設定攝像頭幀率FPS
阿新 • • 發佈:2019-02-11
通常情況下呼叫cap.set(cv2.cv.CV_CAP_PROP_FPS ,10)
是不會起作用的,可以嘗試使用如下方法:
CV_CAP_PROP_FPS is a NOT a fake. See cap_libv4l.cpp(原始碼) in OpenCV github repo. The key is to make sure, you use libv4l over v4l while configuring OpenCV. For that, before running cmake, install libv4l-dev
sudo apt-get install libv4l-dev
Now while configuring OpenCV with cmake, enable option, WITH_LIBV4L
. If all goes good, in configuration status, you will see some thing similar to below
V4L/V4L2: Using libv4l1 (ver ) / libv4l2 (ver )
And then while building your OpenCV code, you will have to link with libv4l1/libv4l2/libv4lconvert.
Arbitary FPS values at the resolutions you choose, needn’t be supported by your webcam. You may check supported resolutions/fps with a graphical tools like cheese or commands like lsusb (2)
參考文獻: