ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Measure currently playing content frame rate

Open aarondib opened this issue 8 years ago • 2 comments

Hi!

Is it possible (or a feature for the future updates) to measure currently playing content frame rate? This can be done by measuring time between several consequent rendered frames. Possibly, by allowing access to onFrameRendered(...) in OnFrameRenderedListenerV23. This seems to be more precise method, then mentioned in https://github.com/google/ExoPlayer/issues/2563 by counting amount of renderedBuffers in SimpleExoplayer.getVideoDecoderCounters().

aarondib avatar Apr 05 '18 08:04 aarondib

To get an accurate estimate of the rate at which frames are being rendered, you could subclass MediaCodecVideoRenderer and override renderOutputBuffer (used before API 21) and renderOutputBufferV21 (used from API 21) and use the information passed in to do the calculation. If you want to take into account dropped frames you'd also need to override dropOutputBuffer.

andrewlewis avatar Apr 05 '18 18:04 andrewlewis

@andrewlewis it's worked quite well. Thanks!

aarondib avatar Apr 09 '18 15:04 aarondib