如何在 OpenCV 中获取网络摄像头的 fps 速率?
所以我需要在 OpenCV 中获取网络摄像头的 fps 速率。哪个函数可以做这样的事情?
So I need to get web camera fps rate in OpenCV. Which function can do such thing for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
与
property_id = CV_CAP_PROP_FPS
with
property_id = CV_CAP_PROP_FPS
似乎对于实时网络摄像头捕获,您可以设置任意 fps 并读回相同的 fps,这与网络摄像头的真实 fps 无关。这是一个错误吗?
例如:
稍后
会给你 500。
但是如果我使用 网络摄像头 fps 链接,大约是正常的 30fps。
It seems that for live webcam capture, you can set an arbitrary fps and read back that same fps, which has nothing to do with the real fps from webcam. Is it a bug?
For example:
and later
will give you 500.
But if I timed it using web cam fps link, it's around the normal 30fps.
就我而言, fps = video.get(cv2.CAP_PROP_FPS) 不起作用。
所以,我在此链接中找到了此代码:
https://www.learnopencv.com/how-to-find-frame-rate-or-frames-per-second-fps-in-opencv-python-cpp/< /a>
In my case, fps = video.get(cv2.CAP_PROP_FPS) did not work.
So, I found this code in this link:
https://www.learnopencv.com/how-to-find-frame-rate-or-frames-per-second-fps-in-opencv-python-cpp/
*OpenCV 2 解决方案:
例如
*OpenCV 2 solution:
E.g.