如何测量html5视频播放时的实时FPS
我正在研究测量 html5 视频的实时帧速率,有人有一些想法吗?由于我没有找到有关 html5 视频中帧的属性信息,所以我不知道如何做到这一点。
另一种选择,如何访问 html5-video 显示的每个帧(可能在播放时有丢帧)。我尝试过使用canvas通过drawImage从视频中获取图像,并通过getImageData获取帧数据,但是似乎获取到的帧数据与视频中逐帧播放的不一样,可能播放了100帧,但我们可以通过 getImageData 方法获取 120 0r 70 等帧。
那么综上所述,如何获取html5视频播放时实时显示的fps或每一帧?
I'm working on measuring the real-time frame rate of html5 video, does anyone has some ideas? Since I have not find the properties info about frame in html5 video, I have no idea about how to do that.
Another alternative, how to access each frame that html5-video displayed(maybe there are drop frame while playing). I have tried to use canvas to get image from video by drawImage, and get the frame data by getImageData, but it seems that the frame data obtained is not the same as the frame by frame played in video, maybe there are 100 frames played, but we can get 120 0r 70 etc frames by getImageData method.
So in summary, how to get the real time fps or each frame displayed while playing for html5 video?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HTML5 视频标签尚不支持丢帧或真实 fps 指标。然而,有人建议将来添加此类指标。更多详情请访问 http://wiki.whatwg.org/wiki/Video_Metrics。该页面还包含 Flash 等其他播放器的视频指标。
HTML5 video tag does not support dropped frames or real fps metric yet. However there is a proposal to add such metrics in future. More details at http://wiki.whatwg.org/wiki/Video_Metrics. The page also has video metrics for other players like flash.