How to set minimum amount of data/chunks to be buffered before start of playback #6697
Comments
|
Hi, Anyone has any thought on this? |
Can you be a bit more specific here? Did you create a subclass of I don't think you need to make a subclass btw (and maybe you didn't and I misunderstood) - I think you can use
Yes - as you've seen in the documentation, that constant is used for both min & max video playback. This was changed in 9725132. Note that if you use the Builder approach I suggested above, you can still set the min & max buffer durations for video separately.
What's your expectation? It seems if you say "download up to 1000ms of video" but your video is in 5s chunks, then it's going to need to download at least a whole chunk. You've noticed yourself that it's downloading the same chunk twice at different bit rates due to ABR - so in a way (barring Q4 about the ABR behaviour) this seems expected. Same for 6000ms resulting in 4 chunks (presumably 2x low bitrate, 2x same chunks at higher bitrate?).
Not out of the box - because
I suspect this is likely due to how bandwidth is measured - @tonihei might have more info here. |
Actually no. This buffer is the maximum the player attempts to load in total. This unrelated to the start of the playback. The buffer needed to start playback is called
Looks like this is why it downloads more chunks than you expect.
Could you explain why you can`t define the time in milliseconds? It seems preferable to use a time-based constraint that is independent of the chunk size. The player will continue the load the next chunk anyway, so the buffer needed for playback start is not really related to any chunk boundaries. And as @icbaker pointed out, some media isn't chunk-based and can only use milliseconds anyway.
The selected format is based on the bitrate estimate of the network. If no other information is available, the bitrate is estimated based on the country and the network type of the user. You can overwrite the estimates at multiple levels of granularity in |
|
Hi, We are using the CustomLoadControl code (explained here https://github.com/Sriharia/ExoPlayer-StatsForNerds/blob/master/demo/src/main/java/com/google/android/exoplayer2/demo/CustomLoadControl.java) to configure the buffer durations Below is our code
We have defined the buffer durations in the custom load control. So as I understand from the above comments, downloading of same chunks of different bitrates is expected as the player is in ABR mode. We are also using the BandwidthMeter to set the initial bitrate. So, If we set the initial bitrate to say 900k and the value of bufferForPlaybackMs to duration of 1 chunk (in our case 5s), will the player start playing immediately after downloading the first chuck, whatever bitrate it may be ? |
That's not expected and only happens in certain cases where HLS media playlist don't contain independent segments.
Yes, if you set the bufferForPlaybackMs to 5 seconds, playback starts as soon as 5 seconds of media has been buffered (which may be one chunk in your case). |
|
Thanks for the link to Since that's not owned or maintained by ExoPlayer Team, we can't really answer questions about its behaviour (including the meaning of We can help you with questions about the behaviour of |
|
Thanks for the replies. |
|
Hey @krackjack234. We need more information to resolve this issue but there hasn't been an update in 14 days. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
[REQUIRED] Searched documentation but could not find direct answer
[REQUIRED] Question
We want to control the minimum number of chunks/data that the player should load before it should start playback
We changed the below values in CustomLoadControl and added it to exoplayer overriding default load control
For us, our HLS chunk duration is 5s.
When we set the
DEFAULT_MAX_BUFFER_MSto 1000ms we see 2 chunk getting downloaded (one with smaller bitrate and then same chunk of a higher bitrate, since player is in ABR mode)When we set
DEFAULT_MAX_BUFFER_MSto 6000ms we see 4 chunks getting downloaded.We want to know the following
DEFAULT_MAX_BUFFER_MSvariable to be used to set the minimum buffer size before player can start to play? Documentation says "For playbacks with video, this is also the default minimum duration of media that the player will attempt to ensure is buffered." The other paramDEFAULT_MIN_BUFFER_MSseems to be only applied for playbacks without video.Any pointers will be greatly appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: