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

HLS - Control over initial variant selection during adaptive playbacks #1276

Closed
AlirezaGhanbarinia opened this issue Feb 17, 2016 · 15 comments
Closed

Comments

@AlirezaGhanbarinia
Copy link

I use Exoplayer for playing multi bit rate HLS stream. How to start playing with the lowest possible quality segment in master .M3U8 file?

@ojw28 ojw28 changed the title Exoplayer multi bit rate stream, how to start with the lowest quality segment of HLS HLS - Control over initial variant selection during adaptive playbacks Feb 18, 2016
@ojw28
Copy link
Contributor

ojw28 commented Feb 18, 2016

ExoPlayer currently selects the first variant listed in the master playlist. If I remember correctly, this is what Apple recommends/specifies as correct client behavior. If you want to start in the lowest quality, you should technically have your server generate the master playlist with the lowest quality listed first.

The above aside, we do agree that it makes more sense for the client to make the initial variant selection locally, as opposed to the recommended behavior. We'll be moving HLS over to use FormatEvaluator in ExoPlayer V2, which will give more control over the initial selection (and over the adaptive algorithm in general).

@eshkoliGilad
Copy link

@ojw28

If I may ask, why does Exoplayer waits until the first segment completed until it determines the next segment quailty ?

Is it possible that we can manage ExoPlayer to change the quality of a segment before it ends ?

If so, would it be seamless transition ?

Thanks !

@ojw28
Copy link
Contributor

ojw28 commented Jun 29, 2016

I'm not sure what you mean when you refer to the seamlessness of the transition. The variant transitions are already (more or less) seamless.

@eshkoliGilad
Copy link

Leave alone for the seamless transition because it does work like you said.

My problem is that my HLS segments are divided to 10 sec chunks and when I start a video it is always starts with the lowest quality possible, even if the network has great connectivity. Only after a segment is played, the next segment changed and starts with the right quality based on bandwidth. Why is that that I must wait for the first segment to end before that transition has invoked ?

@ojw28
Copy link
Contributor

ojw28 commented Jun 29, 2016

If you try and switch too soon then you have very little bandwidth data on which to reliably base the decision. Also, because HLS sucks, you also need to download overlapping chunks of media. This further increases the probability of a re-buffer should you switch too soon. You're better off just selecting the variant you want up front (e.g. based on whether there's a WiFi connection, or similar) than trying to switch up very quickly. This will be possible in 2.x.

@natez0r
Copy link
Contributor

natez0r commented Jul 26, 2016

@ojw28 is there any guidance on when v2 may be available? Trying to decide if we should do something in the meantime.

@ojw28
Copy link
Contributor

ojw28 commented Jul 28, 2016

The answer depends on what level of risk you're comfortable with, and what it means for it to be available :). It's already available in experimental form here. We have some major changes coming next week, so I'd definitely hold off until then. Once those are pushed, probably toward the end of next week, we'll remove "experimental" from the branch name. It will still be a dev branch and not a release branch. Once that happens, you'll need to decide what level of risk you're comfortable with in terms of whether you want to start looking at it or wait a little longer. At Google, we've just started to transition the first of our internal apps over, if that helps you to assess.

@natez0r
Copy link
Contributor

natez0r commented Jul 28, 2016

great, thanks for the detailed update @ojw28. Much appreciated.

@gvader
Copy link

gvader commented Mar 3, 2017

Maybe not best place, but didn't want to open separated issue for this. I am using Exo 2.2.0, and want to get list of available video variants from Playlist. The data is available within HlsMasterPlaylist class, but I am unable to get it without modifying the code.

I am using SimpleExoPlayer with DefaultBandwithMeter and HlsMediaSource for adaptive playback.

@AquilesCanta
Copy link
Contributor

AquilesCanta commented Mar 3, 2017

Please, do open a new issue. But please be clearer about what you need. For example, why ExoPlayer.getCurrentTrackGroups() does not provide the information you need.

@ram992
Copy link

ram992 commented Apr 21, 2017

Hello @ojw28 , you have mentioned that in v2 of ExoPlayer it is possible to select the initial Track of the Hls Stream, can you give me more details on how to do that.
And one more question, If I set any track at the time of init, will the autoAdaptation works like the way it used to before setting it.
And is there any way for setting a defaultBandWidth at the time of building a HlsRendererBuilder, so that a higher quality track plays before the bandWidth Estimate is ready.

@AquilesCanta
Copy link
Contributor

@ram992, you can provide your own TrackSelection.Factory to DefaultTrackSelector. Before implementing one from scratch, have a look at AdaptiveTrackSelection.Factory. Its parameters may provide enough customization for your case.

Can this issue be closed? It seems to me that #2353's commit fixes this.

@ram992
Copy link

ram992 commented Apr 21, 2017

My requirement is to simply start from a bit higher bandwidth track. Can this be implemented without creating a custom track selector. And choosing that should not stop the player from auto adapting once the bandwidth meter has estimate.

@ram992
Copy link

ram992 commented Apr 29, 2017

@AquilesCanta any info

@AquilesCanta
Copy link
Contributor

As I mention in my previous comment:

Before implementing one from scratch, have a look at AdaptiveTrackSelection.Factory. Its parameters may provide enough customization for your case.

From what you mention, it should be enough. For general programming questions I'd suggest trying Stack Overflow.

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

No branches or pull requests

7 participants