video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.81k stars 2.57k forks source link

[metrics] metrics show realtime video bitrate #4752

Closed jinleileiking closed 2 years ago

jinleileiking commented 2 years ago

Is your feature request related to a problem? Please describe.

NO

Describe the solution you'd like

I Know there is a window show bitrate in Real-time metrics. But this bitrate is calculated by (ts/m4s file size) / download time. I need a bitrate for video. I get a way to calculate this: bitrate = ts size / (lastPTSInTs - firstPTSInTs)

Additional context

No response

robwalch commented 2 years ago

You can get this from Level.realBitrate from any event or method that returns a level object.