Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.13k stars 1.68k forks source link

Improve abandon request rule #3840

Closed bbert closed 9 months ago

bbert commented 2 years ago
Environment
Steps to reproduce
  1. Please provide clear steps to reproduce your problem

  2. open reference test page

  3. Open options and enable AbandonRequestsRule

  4. Load the content on netwrok with high bandwith

  5. wait for buffer to be full at highest quality

  6. open browser dev tools and limit network for example to 500kb/s

  7. If the bug is intermittent, give a rough frequency if possible

Observed behavior

Once a segment is abandonned, next segment will still be downloaded at the highest quality => the measured bandwith of the abandonned segment is not considered when determining next quality

Console output
[74282][StreamProcessor][video] OnFragmentLoadingCompleted for stream id defaultId_0 and media type video - Url: https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/5/0021.m4s  
14:45:09.334 Debug.js:169 [74289][BufferController][video] Buffered range: 40 - 83.999999, currentTime =  59.883171 
14:45:09.335 Debug.js:169 [74289][ScheduleController][video] Appended bytes for video and stream id defaultId_0 
14:45:09.339 Debug.js:169 [74294][ScheduleController][video] Media segment needed for video and stream id defaultId_0 
14:45:09.339 Debug.js:169 [74294][StreamProcessor][video] Next fragment request url for stream id defaultId_0 and media type video is https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/5/0022.m4s 
14:45:17.965 Debug.js:169 [82920][BufferController][video] video: Removing buffer from: 0 to 48.514618999999996 
14:45:17.966 Debug.js:169 [82921][BufferController][video] onRemoved buffer from: 0 to 48.514618999999996 
14:45:17.966 Debug.js:169 [82921][BufferController][video] Buffered range: 50 - 83.999999, currentTime =  68.516421 
14:45:32.600 Debug.js:169 [97555][AbandonRequestsRule] [video] frag id 21  is asking to abandon and switch to quality to  0  measured bandwidth was 522 
14:45:32.601 Debug.js:169 [97556][FragmentModel][video] abort requests 
14:45:32.601 Debug.js:169 [97556][StreamProcessor][video] onFragmentLoadingAbandoned request: https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/5/0022.m4s has been aborted 
14:45:32.601 Debug.js:169 [97556][StreamProcessor][video] onFragmentLoadingAbandoned request: https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/5/0022.m4s has to be downloaded again, origin is not seeking process or switch track call 
14:45:32.602 Debug.js:169 [97557][AbrController] Stream ID: defaultId_0 [video] switch from 4 to 0/4 (buffer: 7.728) {"name":"AbandonRequestsRule","throughput":522,"fragmentID":21} 
14:45:32.602 Debug.js:169 [97557][StreamProcessor][video] Preparing quality switch for type video 
14:45:32.606 Debug.js:169 [97561][FragmentModel][video] abort requests 
14:45:32.618 Debug.js:169 [97573][AbrController] Stream ID: defaultId_0 [video] switch from 0 to 4/4 (buffer: 7.728) {"state":2,"throughput":12765.6,"latency":533.75,"bufferLevel":7.728,"placeholderBuffer":17.41315032676972,"delay":0} 
14:45:32.618 Debug.js:169 [97573][StreamProcessor][video] Preparing quality switch for type video 
14:45:32.625 Debug.js:169 [97580][FragmentModel][video] abort requests 
14:45:32.629 Debug.js:169 [97584][AbrController] [video] switching from buffer occupancy to throughput ABR rule (buffer: 0.822). 
14:45:32.635 Debug.js:169 [97590][ScheduleController][video] Media segment needed for video and stream id defaultId_0 
14:45:32.636 Debug.js:169 [97591][DashHandler][video] Index for time 86 is 21 
14:45:32.636 Debug.js:169 [97591][StreamProcessor][video] Next fragment request url for stream id defaultId_0 and media type video is https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/5/0022.m4s 
14:45:33.222 Debug.js:169 [98177][StreamProcessor][video] Buffer is empty! Stalling! 
14:45:33.223 Debug.js:169 [98178][BufferController][video] Waiting for more buffer before starting playback 
14:45:34.764 Debug.js:169 [99719][BufferController][video] video: Removing buffer from: 0 to 65.313832 
14:45:34.769 Debug.js:169 [99724][BufferController][video] onRemoved buffer from: 0 to 65.313832 
14:45:34.769 Debug.js:169 [99724][BufferController][video] Buffered range: 66 - 83.999999, currentTime =  85.31889 
14:45:44.765 Debug.js:169 [109720][BufferController][video] video: Removing buffer from: 0 to 66.380672 
14:45:44.767 Debug.js:169 [109722][BufferController][video] onRemoved buffer from: 0 to 66.380672 
14:45:44.767 Debug.js:169 [109722][BufferController][video] Buffered range: 68 - 83.999999, currentTime =  86.380672 
14:45:59.870 Debug.js:169 [124825][StreamProcessor][video] OnFragmentLoadingCompleted for stream id defaultId_0 and media type video - Url: https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/5/0022.m4s  
Expected behavior

If a segment is abandonned, next segment shall be downloaded at a lower (or at the lowest?) quality

bbert commented 2 years ago

Additional comment: AbandonRequestRule is considering and counting the download progress steps only if buffer level is lower than stable buffer size (12sec by default). It may be better to count all the progress steps whatever the buffer size, and then considering abandon request only if buffer is lower than stable buffer size. If a request download is started just before the buffer goes below stable buffer size, then if the download is too slow and takes more than 12sec it will never be abandonned.

tuantranthai commented 2 years ago

I got the same observation in another test compared to yours.

dsilhavy commented 2 years ago

Some initial changes and fixes here: https://github.com/Dash-Industry-Forum/dash.js/pull/3944

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. However, it might still be relevant so please leave a short comment if it should remain open. Otherwise the issue will be closed automatically after two weeks. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because no further activity occurred. If you think this issue is still relevant please reopen it or contact @dsilhavy. Thank you for your contributions.

dsilhavy commented 9 months ago

Addressed in #4369