C#使用Aforge.net 采集摄像头视频的帧速fps

我是沙拉酱 2014-06-26 06:03:09
我有使用 videoSource.FramesReceived 这个,但是返回给我的值 都是 0到 3 之前的.
有什么办法可以获取到准确的帧速.
...全文
1070 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
losenetway 2016-03-31
  • 打赏
  • 举报
回复
videoSource.FramesReceived取过之后就归0了
泡泡龙 2014-06-28
  • 打赏
  • 举报
回复
是不是公式算错了,把10~30弄成了0~3
save4me 2014-06-28
  • 打赏
  • 举报
回复
源码里的一个例子中有下面的代码:

        // On timer tick - update FPS info
        private void timer_Tick( object sender, EventArgs e )
        {
            if ( videoSource != null )
            {
                // get number of frames since the last timer tick
                int framesReceived = videoSource.FramesReceived;

                if ( stopWatch == null )
                {
                    stopWatch = new Stopwatch( );
                    stopWatch.Start( );
                }
                else
                {
                    stopWatch.Stop( );

                    float fps = 1000.0f * framesReceived / stopWatch.ElapsedMilliseconds;
                    fpsLabel.Text = fps.ToString( "F2" ) + " fps";

                    stopWatch.Reset( );
                    stopWatch.Start( );
                }
            }
        }
我是沙拉酱 2014-06-27
  • 打赏
  • 举报
回复
引用 楼主 qq200242842 的回复:
我有使用 videoSource.FramesReceived 这个,但是返回给我的值 都是 0到 3 之前的. 有什么办法可以获取到准确的帧速.
我就是用这个,但是videoSource.FramesReceived获取的FPS就只会出现0到 3 之间.
wangnaisheng 2014-06-26
  • 打赏
  • 举报
回复

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧