Linux下OpenCV设置摄像头帧率FPS

来源:互联网 发布:kindle阅读器软件 编辑:程序博客网 时间:2024/05/24 02:42

通常情况下调用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)




参考文献:

How to set camera FPS in OpenCV? CV_CAP_PROP_FPS is a fake

原创粉丝点击