如何使用DirectShow获取视频流(实时流)的帧率(fps)? [英] How to get Frame rate (fps) of a video stream (live stream) with directshow?

查看:688
本文介绍了如何使用DirectShow获取视频流(实时流)的帧率(fps)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到可以在FPS模式下获取实时视频流帧率的代码.

Hi, i need to find code that can get me the frame rate of a live video stream in FPS mode.

请帮忙!

推荐答案

您是否尝试过使用样本采集器过滤器为每个交付的帧添加到帧计数器变量.然后,您可以每秒获取一次计数并进行重置.我以前使用过这种方法,如果您只是出于简单的调试目的而需要它,它应该足够快速且准确.
Have you tried to use the sample grabber filter to add to a frame counter variable for each frame delivered.  You can then grab the count once a second and reset.  I have used this method before, and if you just need it for simple debugging purposes it should be fast and accurate enough.


BryanWilkins是的,我之前做过,并且成功了!您可以在函数中添加一个简单的计数器,当新帧到达时将调用该计数器,但是存在一个问题,那就是您需要计算添加新帧所花费的时间. :)幸运的是,您可以通过在函数中添加时间计算器来做到这一点,并且可以肯定地看到帧率.

祝你玩得开心.
问我您的问题是否需要更多有关DirectShow的信息.

真诚的Arash Shirkhorshidi.
Hi BryanWilkins yes i did it before and it was successfully worked! you can add just a simple counter in your function that will be called when a new frame arrived, but there is a problem and it is that you need to calculate how much time it takes to add a new frame. :) fortunately you can do this by adding a time calculator to your function and for sure you can see your frame rate easily.

have a nice time.
ask me your question if you need to know more about directshow.

Sincerely Arash Shirkhorshidi.


这篇关于如何使用DirectShow获取视频流(实时流)的帧率(fps)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆