I'm using the dash-if-reference-player and I want to limit the buffer size.
Or set these values
setBufferToKeep()
setBufferPruningInterval()
setBufferTimeAtTopQuality()
Can someone tell me how to do this?
I am confused about same thing... Sadly the documentation does not help in this case. :(
I am also interested in the buffer size. However, as I know from the code, there is no usual way to limit the size of the client buffer, since the player and the ABR-controller seems to be designed to download the videos as much as needed for a stable buffer (to avoid playback stalls).
A unsubtle solution is to set
BufferToKeep=0, BufferTimeAtTopQuality=LimitedSizeYouWant.
But this may cause the stop of the playback. I guess the ABR could not determine what segment to be downloaded next.
@ShineShuai Something that I don't understand is how to edit these values to experiment in the first place. Do I have to edit a file? (I'm using the dash-if-reference-player from the samples folder).
@amaklp a simple way to edit those values for tests is to modify the source file (dash.all.debug.js or dash.all.min.js) used in your sample. You may find the source file you use in index.html. Then change and test the following values in the source file:
const BUFFER_TO_KEEP = 30;
const BUFFER_PRUNING_INTERVAL = 30;
const DEFAULT_MIN_BUFFER_TIME = 12;
const BUFFER_TIME_AT_TOP_QUALITY = 30;
const BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM = 60;
const LONG_FORM_CONTENT_DURATION_THRESHOLD = 600;
const RICH_BUFFER_THRESHOLD = 20;
Please anyone if you get the time, add a feature to limit buffer, its important.
Can someone explain the
DEFAULT_MIN_BUFFER_TIME = 12;
and the
DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH = 20;
options?
I can't find an explanation in the documentation.
I've moved on to shaka player as it provides more features. Looking forward to come back once buffer limit is implemented :)
@amaklp Here are the API docs that will let you override the CONST values you have pointed out.
Use this method to modify this internal default for DEFAULT_MIN_BUFFER_TIME
http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html#setStableBufferTime__anchor
Use this method to modify this internal default for BUFFER_TIME_AT_TOP_QUALITY = 30;
http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html#setBufferTimeAtTopQuality__anchor
Use this method to modify this internal default for BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM = 60;
http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html#setBufferTimeAtTopQualityLongForm__anchor
Disable this and DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH will have an effect.
http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html#setFastSwitchEnabled__anchor
The two settings we are missing is a way to set the FastSwitch buffer target which is an easy fix. The harder change that we really need is a way to set a STARTING buffer target which will have to meet or exceed before we render any content.
Disable this and DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH will have an effect.
http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html#setFastSwitchEnabled__anchor
How can this value be boolean if on the dash.all.debug.js it is
DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH = 20
Because it doesn't set the buffer time, it enables/disables the buffer switching mode:
Disable this and DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH will have an effect.
Unfortunately, as mentioned, you can't currently set this value via any API:
The two settings we are missing is a way to set the FastSwitch buffer target which is an easy fix.
Sorry, I'm confused.
I use the dash-if-reference-player from the samples folder, which uses the dash.all.debug.js from the dist folder.
This file contains these lines
var BUFFER_TO_KEEP = 30;
var BUFFER_PRUNING_INTERVAL = 30;
var DEFAULT_MIN_BUFFER_TIME = 12;
var DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH = 20;
var BUFFER_TIME_AT_TOP_QUALITY = 30;
var BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM = 60;
var LONG_FORM_CONTENT_DURATION_THRESHOLD = 600;
var RICH_BUFFER_THRESHOLD = 20;
Which I guess these are the values I should be experiment with. Right?
What setStableBufferTime on MediaPlayer.js has to do with BUFFER_TO_KEEP = 30 on dash.all.debug.js.
Is the value 30 being attached to setStableBufferTime which is
The time that the internal buffer target will be set to post startup/seeks (NOT top quality).
?
No you should use the API I pointed out. But since there is not API to set the int value for fast switch buffer target, you need to either manipulate the CONST and rebuild or disable the feature. Better add a n api to set it properly as a new PR.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because no further activity occurred. If you think this issue is still relevant please reopen it. Thank you for your contributions.
Most helpful comment
No you should use the API I pointed out. But since there is not API to set the int value for fast switch buffer target, you need to either manipulate the CONST and rebuild or disable the feature. Better add a n api to set it properly as a new PR.