得到一个当前正在播放的视频的帧速率 [英] getting the frame rate of a currently playing video
问题描述
我想知道 - 有没有办法让一个Android videoView目前效力于该帧速率。我看着VideoView类别的文档,但它是无济于事。有一些其他的方式来做到这一点?
I was wondering - is there a way to get the frame rate at which an Android videoView is currently playing. I looked into the documentation of the VideoView class but it was to no avail. Is there some other way to do this?
感谢。
推荐答案
当然可以。
VideoView扩展视图,所以你会做延伸VideoView自己YourVideoView类中,实现的onDraw方法,调用super.onDraw那里,也有执行你的FPS计算。
VideoView extends View, so you'd make your own YourVideoView class which extends VideoView, implement onDraw method, call super.onDraw there, and also performing your FPS computation there.
所以,你可以自己算多少次谢胜利的onDraw被调用VideoView。它显示你需要的地方(屏幕/ logcat中/ ...)。
So you can count yourself how many times in secound onDraw is called for VideoView. Display it wherever you need (on screen / logcat / ...).
计数的帧率是另一回事,你可以看看这里简单的例子。
Counting framerate is another story, you can look for simple example here.
这篇关于得到一个当前正在播放的视频的帧速率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!