Linux下OpenCV设置摄像头帧率FPS

本文介绍了一种通过配置OpenCV来实现设置摄像头帧率(FPS)的有效方法。关键在于确保使用libv4l而不是v4l进行配置。首先安装libv4l-dev,然后在cmake配置OpenCV时启用WITH_LIBV4L选项。最后,在链接阶段,还需要链接到libv4l1、libv4l2和libv4lconvert。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值