开发者

getting the frame rate of a currently playing video

开发者 https://www.devze.com 2023-04-08 16:13 出处:网络
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

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 t开发者_Python百科o do this?

Thanks.


Yes you can.

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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号