-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Hi,
I have a following question about changing the bit-rate in HLS stream.
With the current exoplayer implementation, if client has great bandwidth improvement then it will take effect only after the buffered duration of the video is played. Because chunks are always downloaded in the increasing sequence at the end of the buffer.
I know that I can reduce the buffer size but that's not how I want to solve the problem.
I have made some changes to start downloading the improved bit-rate chunk which is 2 chunks away from the currently playing chunk.
So for example,
Chunk Duration: 2 seconds
Currently Playing Chunk : Number 5
At this moment we see bandwidth improvement
So I start downloading chunk number 7 at new bit-rate.
And in this case, the client will see improved quality starting chunk number 7 itself which is less than 4 seconds away. And all that work fine.
Here's the problem I am facing:
When I start downloading new chunk (number 7 in the example) at higher bit-rate, exoplayer turns on splicing and it removes all the old chunk samples at old bit-rate. For example, I had 15 chunks in buffer (Chunk number 5 to chunk number 19), then all of them will be discarded.
In my case, I want to have a flexibility of choosing between new chunk and old chunk. Meaning, if new chunk at new bit-rate is downloaded in time, I want to play them but if not, I don't want to get into buffering situations since I could have just played old chunks at old bit-rate which were already downloaded before.
simply, disabling splicing doesn't work in this case.
I hope I am able to explain my problem properly.
Basically, I am trying to be aggressive with bit-rate change but at the same time, I don't want to get into playback buffering for the chunks which were already downloaded but sadly discarded :(
Could you suggest what possible things I could try so that I can keep multiple chunks at same timestamps and then choose them with more freedom?
Thanks a lot in advance.
Shalin