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.12k stars 1.67k forks source link

SourceBuffer append failed "QuotaExceededError: The quota has been exceeded. #2934

Closed thanawatkie closed 3 years ago

thanawatkie commented 5 years ago
Environment
Steps to reproduce
  1. Please provide clear steps to reproduce your problem The playback stop playing when reaching some point

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

Observed behaviour

Describe what the player is doing that is unexpected or undesired behaviour. The player buffer indefinite

Console output
[296462][SourceBufferSink] SourceBuffer append failed "QuotaExceededError: The quota has been exceeded." Debug.js:233:25
[296463][BufferController][audio] Quota exceeded for type: audio, Critical Buffer: 546.8672008000002 Debug.js:233:25
[296464][BufferController][audio] Clearing playback buffer to overcome quota exceed situation for type: audio Debug.js:233:25
[306013][SourceBufferSink] SourceBuffer append failed "QuotaExceededError: The quota has been exceeded." Debug.js:233:25
[306015][BufferController][audio] Quota exceeded for type: audio, Critical Buffer: 546.8501344 Debug.js:233:25
[306017][BufferController][audio] Clearing playback buffer to overcome quota exceed situation for type: audio Debug.js:233:25
[318175][SourceBufferSink] SourceBuffer append failed "QuotaExceededError: The quota has been exceeded." Debug.js:233:25
[318176][BufferController][audio] Quota exceeded for type: audio, Critical Buffer: 546.8501344 Debug.js:233:25
[318176][BufferController][audio] Clearing playback buffer to overcome quota exceed situation for type: audio Debug.js:233:25
[328646][SourceBufferSink] SourceBuffer append failed "QuotaExceededError: The quota has been exceeded." Debug.js:233:25
[328646][BufferController][audio] Quota exceeded for type: audio, Critical Buffer: 546.8501344 Debug.js:233:25
[328649][BufferController][audio] Clearing playback buffer to overcome quota exceed situation for type: audio Debug.js:233:25
[337832][BufferController][video] Detected unintended removal from: 4090.76 to 4120.76 setting index handler time to 4090.76 Debug.js:233:25
[338124][SourceBufferSink] SourceBuffer append failed "QuotaExceededError: The quota has been exceeded." Debug.js:233:25
[338125][BufferController][audio] Quota exceeded for type: audio, Critical Buffer: 546.8501344 Debug.js:233:25
[338125][BufferController][audio] Clearing playback buffer to overcome quota exceed situation for type: audio 
fvalleeHbbTV commented 5 years ago

My 2cents: not sure if it's related (and the provided stream doesn't seems to start due to drm) but from my experience (not tested with latest release), I think the buffering is not actually reduced when a QuotaExceededError error is detected.

In the BufferController, QUOTA_EXCEEDED_ERROR_CODE is detected in onAppended and setBufferToKeep/setBufferAheadToKeep are used to reduce buffering, but I think setStableBufferTime/setBufferTimeAtTopQuality/setBufferTimeAtTopQualityLongForm should also be used to ensure there is no prune / exceed the quota / prune infinite loop.

epiclabsDASH commented 5 years ago

I need to take a look at this. Reducing all the other buffers sizes is a good idea but that shouldn't avoid the player to start after a quota exceeded situation (we are removing the buffer at that point so some time should happen before the buffer limits are reached).

@thanawatkie, could you please check if you can reproduce this problem in #2943? It has a fix for how we deal with parts of the buffer that were removed.

comrat commented 5 years ago

Hello everyone! I've the same issue. I've tried #2943 too but it's still reproduced

makisp commented 4 years ago

Hello, is there any news on this? We're having this issue on the latest release...

Witos commented 4 years ago

+1

vgarleanu commented 4 years ago

Hi, Im experiencing the same bug except with the video buffer, with the same message, causing dash.js to go in a deadlock and request the same chunks indefinitely. Whats the status on this issue?

francoism90 commented 4 years ago

I'm having the same issue it seems: [133][BufferController][video] Detected unintended removal from: 9.041666 to 10.375 setting index handler time to 9.041666 It keeps buffering like crazy and makes Firefox crash.

Did anyone solves this? Thanks.

peijl1998 commented 3 years ago

Hi, Im experiencing the same bug except with the video buffer, with the same message, causing dash.js to go in a deadlock and request the same chunks indefinitely. Whats the status on this issue?

Hi, I have the same problem. Do you know how to fix it? Requesting the same chunk in a deadlock state is so annoying :(

stale[bot] commented 3 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.

dsilhavy commented 3 years ago

Unstale

dsilhavy commented 3 years ago

Anyone in this thread still facing this problem and can check if it is solved in 4.0:

https://reference.dashif.org/dash.js/nightly/samples/

francoism90 commented 3 years ago

@dsilhavy How can I install this with npm? :)

dsilhavy commented 3 years ago

The current dev version is not available on npm. You need to clone this repo, checkout the development branch and follow the instructions to build the project.

lifegpc commented 3 years ago

I have same problems when I try to play very large video. (~30000kbps)

dsilhavy commented 3 years ago

@lifegpc can you share your stream? try to adjust the following values to reduce data in the buffer:

bufferToKeep,
bufferTimeAtTopQuality,
bufferTimeAtTopQualityLongForm,
stableBufferTime
lifegpc commented 3 years ago

Here is the video. I create it by using ffmpeg. command line: ffmpeg -i 00001.mkv -i 00001_opus320.ogg -map 0:0 -map 1:0 -c copy -adaptation_sets "id=0,streams=v id=1,streams=a" -single_file 1 -f dash 00001-big.mpd Test it on Firefox Nightly (91.0a1 (2021-06-27) (64-bit))

dsilhavy commented 3 years ago

@lifegpc can you please check if #3691 solved your issue. it is available in nightly: https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

lifegpc commented 3 years ago

@lifegpc can you please check if #3691 solved your issue. it is available in nightly: https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

Seems works fine.

dsilhavy commented 3 years ago

Fixed in #3691

ParasPidurkar commented 1 year ago

@dsilhavy are these changes available as part of the dashjs npm module .How can i take these changes as the npm module .

dsilhavy commented 1 year ago

The latest stable version (4.6.0) is available on npm it includes this change: https://www.npmjs.com/package/dashjs?activeTab=versions

ParasPidurkar commented 1 year ago

@dsilhavy Even after updating to version 4.6.0 the issue of quota Exceed is observed in Firefox 111.0.1 (64-bit)

7401][SourceBufferSink][video] SourceBuffer append failed "QuotaExceededError: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers."

dsilhavy commented 1 year ago

@ParasPidurkar This is not a dash.js issue but rather a configuration platform issue. dash.js adjusts the buffer target once such a message is disptached by the MSE. Try to reduce the buffer target values.

ParasPidurkar commented 1 year ago

@dsilhavy I have updated the buffer target values after which this issue is not observed on the chrome but observed in firefox. also when i use the ultra hd streams this issue is observed in all the browsers.Not sure what might be the issue .

dsilhavy commented 1 year ago

There is only limited space available which differs between the browsers. UHD typically requires higher bitrates so you need to limit the data that is persisted in the buffers even further. Unfortunately, there is no API to query these limits so it is more or less trial and error.

shreyaskaundinya commented 2 months ago

i'm using Dash player with timingsrc and DRM

getting this error continously

mediasync.js:263 [794192][BufferController][video] Caught error on create SourceBuffer: NotSupportedError: Failed to execute 'changeType' on 'SourceBuffer': Changing to the type provided ('video/mp4;codecs="avc1.64002a"') is not supported.

mediasync.js:263 [794763][BufferController][audio] Caught error on create SourceBuffer: QuotaExceededError: Failed to execute 'addSourceBuffer' on 'MediaSource': This MediaSource has reached the limit of SourceBuffer objects it can handle. No additional SourceBuffer objects may be added.

@dsilhavy please help

dsilhavy commented 2 months ago

@shreyaskaundinya It looks like dash.js is trying to use changeType and the method is not properly implemented on the platform. Try playing around with useChangeTypeForTrackSwitch and resetSourceBuffersForTrackSwitch as documented here: https://cdn.dashjs.org/latest/jsdoc/module-Settings.html