Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature abr optimizations #3653

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e794cca
Reduce timeout before checking gaps
dsilhavy May 27, 2021
d4f93ee
Merge branch 'development' of https://github.com/Dash-Industry-Forum/…
dsilhavy May 28, 2021
af37ee8
WiP: Allow individual configuration of ABR additional ABR rules
dsilhavy May 28, 2021
baad5c9
Merge branch 'development' of https://github.com/Dash-Industry-Forum/…
dsilhavy May 31, 2021
59512e1
Minor refactor in HTTPLoader.js and ThroughputRule.js
dsilhavy May 31, 2021
b179ab0
WiP: Adjust ref UI and add more ABR settings
dsilhavy May 31, 2021
c93d0d6
Add ABR config to reference UI
dsilhavy May 31, 2021
947c4a2
Minor reference UI corrections
dsilhavy May 31, 2021
009f855
Add additional ABR samples Section
dsilhavy May 31, 2021
07fb366
Add info panel for sample section in reference client
dsilhavy May 31, 2021
3200a97
Add additional ABR samples
dsilhavy May 31, 2021
6785e71
Fix initialBufferLevel for VoD content
dsilhavy May 31, 2021
5245a00
Add buffer samples
dsilhavy May 31, 2021
c9e6eeb
dash.js logo for samples without image
dsilhavy May 31, 2021
de340ad
Add missing fields in index.d.ts and MediaInfo.js
dsilhavy Jun 1, 2021
8aa76ce
Fix wrong JSDoc in Settings.js
dsilhavy Jun 1, 2021
8385702
Remove outdated methods from index.d.ts
dsilhavy Jun 1, 2021
ef5b67c
Merge branch 'development' of https://github.com/Dash-Industry-Forum/…
dsilhavy Jun 3, 2021
f08d66d
Add settings flag to enable/disable service description
dsilhavy Jun 3, 2021
a91d72d
Add additional options to reference UI
dsilhavy Jun 3, 2021
b9d84ef
Merge branch 'development' of https://github.com/Dash-Industry-Forum/…
dsilhavy Jun 3, 2021
81a1b37
Merge branch 'development' of https://github.com/Dash-Industry-Forum/…
dsilhavy Jun 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ declare namespace dashjs {
};
streaming?: {
abandonLoadTimeout?: number,
calcSegmentAvailabilityRangeFromTimeline?: boolean,
wallclockTimeUpdateInterval?: number,
lowLatencyEnabled?: boolean,
manifestUpdateRetryInterval?: number,
Expand All @@ -157,12 +156,16 @@ declare namespace dashjs {
fallbackToSegmentTimeline?: boolean
},
metrics?: {
metricsMaxListDepth?: number
maxListDepth?: number
},
delay?: {
liveDelayFragmentCount?: number,
liveDelay?: number,
useSuggestedPresentationDelay?: boolean
useSuggestedPresentationDelay?: boolean,
applyServiceDescription?: boolean
},
protection?: {
keepProtectionMediaKeys?: boolean,
},
buffer?: {
fastSwitchEnabled?: boolean,
Expand All @@ -179,9 +182,6 @@ declare namespace dashjs {
useAppendWindow?: boolean,
setStallState?:boolean
},
protection?: {
keepProtectionMediaKeys?: boolean,
}
gaps?: {
jumpGaps?: boolean,
jumpLargeGaps?: boolean,
Expand Down Expand Up @@ -262,6 +262,12 @@ declare namespace dashjs {
abr?: {
movingAverageMethod?: 'slidingWindow' | 'ewma';
ABRStrategy?: 'abrDynamic' | 'abrBola' | 'abrL2A' | 'abrLoLP' | 'abrThroughput';
additionalAbrRules?: {
insufficientBufferRule?: boolean,
switchHistoryRule?: boolean,
droppedFramesRule?: boolean,
abandonRequestsRule?: boolean
},
bandwidthSafetyFactor?: number;
useDefaultABRRules?: boolean;
useDeadTimeLatency?: boolean;
Expand Down Expand Up @@ -483,14 +489,6 @@ declare namespace dashjs {

setTextTrack(idx: number): void;

getTextDefaultLanguage(): string | undefined;

setTextDefaultLanguage(lang: string): void;

getTextDefaultEnabled(): boolean | undefined;

setTextDefaultEnabled(enable: boolean): void;

provideThumbnail(time: number, callback: (thumbnail: Thumbnail | null) => void): void;

getBitrateInfoListFor(type: MediaType): BitrateInfo[];
Expand Down Expand Up @@ -543,8 +541,6 @@ declare namespace dashjs {

getOfflineController(): OfflineController;

enableManifestDateHeaderTimeSource(value: boolean): void;

displayCaptionsOnTop(value: boolean): void;

attachTTMLRenderingDiv(div: HTMLDivElement): void;
Expand Down
89 changes: 89 additions & 0 deletions samples/abr/abr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Configuration of ABR Rules</title>

<script src="../../dist/dash.all.debug.js"></script>

<!-- Bootstrap core CSS -->
<link href="../lib/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="../lib/main.css" rel="stylesheet">

<style>
video {
width: 640px;
height: 360px;
}
</style>

<script class="code">
function init() {
var video,
player,
url = "https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();

player.updateSettings({
streaming: {
abr: {
useDefaultABRRules: true,
ABRStrategy: 'abrThroughput',
additionalAbrRules: {
insufficientBufferRule: true,
switchHistoryRule: false,
droppedFramesRule: false,
abandonRequestsRule: false
}

}
}
});


player.initialize(video, url, true);
}
</script>
</head>
<body>

<main>
<div class="container py-4">
<header class="pb-3 mb-4 border-bottom">
<img class=""
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
<h3>Configuration of ABR Rules</h3>
<p>Example showing how to define the target ABR rules in dash.js. In this demo we enable the throughput based ABR decision logic. In addition, the InsufficientBufferRule is enabled.</p>
</div>
</div>
<div class="col-md-8">
<video controls="true"></video>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="code-output"></div>
</div>
</div>
<footer class="pt-3 mt-4 text-muted border-top">
&copy; DASH-IF
</footer>
</div>
</main>


<script>
document.addEventListener('DOMContentLoaded', function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<meta charset="utf-8">
<title>Custom ABR Rules</title>

<script src="../../../dist/dash.all.debug.js"></script>
<script src="../../dist/dash.all.debug.js"></script>

<!-- Bootstrap core CSS -->
<link href="../../lib/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="../../lib/main.css" rel="stylesheet">
<link href="../lib/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="../lib/main.css" rel="stylesheet">

<style>
video {
Expand Down Expand Up @@ -51,7 +51,7 @@
<div class="container py-4">
<header class="pb-3 mb-4 border-bottom">
<img class=""
src="../../lib/img/dashjs-logo.png"
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
Expand Down Expand Up @@ -82,6 +82,6 @@ <h3>Custom ABR Rules</h3>
init();
});
</script>
<script src="../../highlighter.js"></script>
<script src="../highlighter.js"></script>
</body>
</html>
81 changes: 81 additions & 0 deletions samples/abr/disable-abr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Disable ABR</title>

<script src="../../dist/dash.all.debug.js"></script>

<!-- Bootstrap core CSS -->
<link href="../lib/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="../lib/main.css" rel="stylesheet">

<style>
video {
width: 640px;
height: 360px;
}
</style>

<script class="code">
function init() {
var video,
player,
url = "https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();

player.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: { audio: true, video: false },
}
}
});


player.initialize(video, url, true);
}
</script>
</head>
<body>

<main>
<div class="container py-4">
<header class="pb-3 mb-4 border-bottom">
<img class=""
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
<h3>Disable ABR</h3>
<p>Example showing how to disable the ABR switching in dash.js.</p>
</div>
</div>
<div class="col-md-8">
<video controls="true"></video>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="code-output"></div>
</div>
</div>
<footer class="pt-3 mt-4 text-muted border-top">
&copy; DASH-IF
</footer>
</div>
</main>


<script>
document.addEventListener('DOMContentLoaded', function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>
82 changes: 82 additions & 0 deletions samples/abr/initial-bitrate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Initial bitrate</title>

<script src="../../dist/dash.all.debug.js"></script>

<!-- Bootstrap core CSS -->
<link href="../lib/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="../lib/main.css" rel="stylesheet">

<style>
video {
width: 640px;
height: 360px;
}
</style>

<script class="code">
function init() {
var video,
player,
url = "https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();

player.updateSettings({
streaming: {
abr: {
initialBitrate: { audio: -1, video: 800 },
autoSwitchBitrate: { audio: true, video: false }
}
}
});


player.initialize(video, url, true);
}
</script>
</head>
<body>

<main>
<div class="container py-4">
<header class="pb-3 mb-4 border-bottom">
<img class=""
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
<h3>Initial bitrate</h3>
<p>Example showing how to set the initial bitrate in dash.js. For visibility reasons the ABR switching is disabled as well.</p>
</div>
</div>
<div class="col-md-8">
<video controls="true"></video>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="code-output"></div>
</div>
</div>
<footer class="pt-3 mt-4 text-muted border-top">
&copy; DASH-IF
</footer>
</div>
</main>


<script>
document.addEventListener('DOMContentLoaded', function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>
Loading