Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the current bitrate and resolution of HLS Video? #646

Closed
sachinbhanot opened this issue Jul 22, 2015 · 8 comments
Closed

How to get the current bitrate and resolution of HLS Video? #646

sachinbhanot opened this issue Jul 22, 2015 · 8 comments

Comments

@sachinbhanot
Copy link

Is it possible to get current bitrate and resolution of playing HLS Video ? when the bit rate is switched and fetch the current bitrate ?

@VishwanathPatil
Copy link

As I know yoy should listen to DefaultBandwidthMeter . It is shown in
Demoplayer.java onBandwidthSample would give you bitrate information.
On Jul 22, 2015 11:08 PM, "Sachin Bhanot" notifications@github.com wrote:

Is it possible to get current bitrate and resolution of playing HLS Video
? when the bit rate is switched and fetch the current bitrate ?


Reply to this email directly or view it on GitHub
#646.

@sachinbhanot
Copy link
Author

but its never come on onBandwidthSample .. unable to fetch bitrate

@VishwanathPatil
Copy link

As I can see through , hlsRenderBuilder has defaultBandwidthMeter

  1. you should get the callback how internally it propgates to DemoPlayer i don't know as Phani-nunna mentioned .
  2. or onRenderers in Demoplayer has bandwidthmeter which you can use to get
    bitrateestimate a public method in DefaultBandwidthMeter
    On Jul 23, 2015 11:37 AM, "Sachin Bhanot" notifications@github.com wrote:

but its never come on onBandwidthSample .. unable to fetch bitrate


Reply to this email directly or view it on GitHub
#646 (comment).

@crossle
Copy link

crossle commented Jul 31, 2015

+1

@ojw28
Copy link
Contributor

ojw28 commented Jul 31, 2015

You should be listening to DemoPlayer.InfoListener.onVideoFormatEnabled. The format is passed to that method whenever the selection changes. Format.bitrate is the bitrate as declared in the master playlist. Format.width and Format.height are the dimensions as declared in the master playlist by RESOLUTION tags. Note that if RESOLUTION tags are omitted from the master playlist then these fields may be set to -1.

You can also use DemoPlayer.Listener.onVideoSizeChanged to determine when the resolution changes.

@ojw28 ojw28 closed this as completed Jul 31, 2015
@crossle
Copy link

crossle commented Jul 31, 2015

@ojw28 How about manual switch the bitrate not auto?

@ojw28
Copy link
Contributor

ojw28 commented Jul 31, 2015

See #676

@piterwilson
Copy link

@ojw28 thanks for the information on how to get the indicated bitrate. How about getting the actual observed bitrate? onBandwidthSample.bitrateEstimate looks promising, but i'm unable to confirm this is what i'm looking for.

@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants