Skip to content

Commit

Permalink
Merge pull request #95 from bitmovin/develop
Browse files Browse the repository at this point in the history
Release v0.9.1
  • Loading branch information
rohrlaf authored Jul 20, 2022
2 parents 0bc6f00 + b331de9 commit 7668358
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 54 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
</br>

> :warning: **This repository is not meant to be used for local development but serves as source for the code samples shown at [bitmovin.com/demos](https://bitmovin.com/demos/).**
</br>
</br>

# Bitmovin Demos
[![bitmovin](http://bitmovin-a.akamaihd.net/webpages/bitmovin-logo-github.png)](http://www.bitmovin.com)

# Introduction
Welcome to Bitmovin demos. Our demo page is hosted at [bitmovin.com/demos](https://bitmovin.com/demos/).
This repository is meant to be used as a reference when integrating our player into your products.

## Testing a demo

Expand Down
86 changes: 46 additions & 40 deletions encoding/av1-break-even-calculator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ <h2 class="my-3">Inputs</h2>
<div class="input-group">
<input class="form-control"
id="encodingCostPerMinute"
min="0"
step="0.01"
min="0.00"
step="0.0001"
type="number"
value="0.02" />
<div class="input-group-append"><span class="input-group-text">$</span></div>
Expand All @@ -26,28 +26,13 @@ <h2 class="my-3">Inputs</h2>
<small>Based on <a href="https://bitmovin.com/pricing/" rel="noreferrer" target="_blank" style="font-size: inherit;">Bitmovin flexible pricing</a></small>
</div>
</div>
<div class="form-group">
<label for="ingressCostPerGb">Ingress cost per GB</label>
<div class="input-group">
<input class="form-control"
id="ingressCostPerGb"
min="0"
step="0.01"
type="number"
value="0" />
<div class="input-group-append"><span class="input-group-text">$</span></div>
</div>
<div>
<small>&nbsp;</small>
</div>
</div>
<div class="form-group">
<label for="egressCostPerGb">CDN delivery cost per GB</label>
<div class="input-group">
<input class="form-control"
id="egressCostPerGb"
min="0"
step="0.01"
min="0.00"
step="0.0001"
type="number"
value="0.04" />
<div class="input-group-append"><span class="input-group-text">$</span></div>
Expand All @@ -58,7 +43,7 @@ <h2 class="my-3">Inputs</h2>
<div class="col-md-6">

<div class="form-group">
<label for="numberOfStreamsUhd">Number of 4K UHD streams (H.264 bitrate: 12 Mbps; billing multiplier: 4)</label>
<label for="numberOfStreamsUhd">Number of 4k UHD streams (H.264 bitrate: 12 Mbps; billing multiplier: 4)</label>
<input class="form-control"
id="numberOfStreamsUhd"
min="1"
Expand Down Expand Up @@ -93,11 +78,8 @@ <h2 class="my-3">Inputs</h2>
</div>

</div>
</form>

<div class="container">

<div class="row">

<div class="col-md-6 my-2">
<div>Break-even point - H.264+AV1 vs H.264 only</div>
<div id="av1-h264" class="font-weight-bold" style="font-size: 24px">--</div>
Expand All @@ -107,14 +89,24 @@ <h2 class="my-3">Inputs</h2>
<div>Break-even point - H.265+AV1 vs H.265 only</div>
<div id="av1-h265" class="font-weight-bold" style="font-size: 24px">--</div>
</div>

</div>
</div>
</form>

<p class="text-justify">
Starting from these numbers of views, supplementing encodings with AV1 becomes more
profitable than the respective codec alone.
</p>

<p class="text-justify">
For ease of comparison this calculator uses a fixed ladder.
We recommend to use
<a href="https://bitmovin.com/per-title-encoding/" rel="noreferrer" target="_blank" style="font-size: inherit;">Per-Title</a>
as it can help reduce the break-even point further.
It will optimize each ladder individually, usually resulting in a reduced number of
renditions for more advanced codecs, hence reduced encoding and storage costs
compared to a fixed ladder.
</p>

<h3 class="my-3">Calculation multipliers</h3>
<p class="text-justify">
These are the multipliers and factors used in our calculation<a href="#formulaFootnote" target="_self" class="btm-footnote"></a>.
Expand All @@ -124,31 +116,37 @@ <h3 class="my-3">Calculation multipliers</h3>
<div class="container">
<div class="row">
<table class="table">
<thead>
<th colspan="3">Multipliers</th>
</thead>
<tbody>
<tr class="table-secondary">
<th colspan="3">Resolution factors</th>
</tr>
<tr>
<th class="col-3">SD</th>
<th class="col-3">HD</th>
<th class="col-3">UHD</th>
<th class="col-3">4k UHD</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>4</td>
</tr>
<tr class="table-secondary">
<th>PerTitle</th>
<th colspan="2">3-Pass</th>
<th colspan="3">Feature factors</th>
</tr>
<tr>
<td>1.1</td>
<td colspan="2">2</td>
<th>3-Pass</th>
<th colspan="2"></th>
</tr>
<tr>
<td>2</td>
<td colspan="2"></td>
</tr>
<tr class="table-secondary">
<th>H264</th>
<th>H265</th>
<th colspan="3">Codec factors</th>
</tr>
<tr>
<th>H.264</th>
<th>H.265</th>
<th>AV1</th>
</tr>
<tr>
Expand All @@ -157,12 +155,17 @@ <h3 class="my-3">Calculation multipliers</h3>
<td>10</td>
</tr>
<tr class="table-secondary">
<th>AV1 efficiency improvement over H.264</th>
<th colspan="2">AV1 efficiency improvement over H.265</th>
<th colspan="3">Efficiency improvements</th>
</tr>
<tr>
<th>AV1 over H.264</th>
<th>AV1 over H.265</th>
<th></th>
</tr>
<tr>
<td>50%</td>
<td colspan="2">30%</td>
<td>30%</td>
<td></td>
</tr>
</tbody>
</table>
Expand All @@ -173,7 +176,10 @@ <h3 class="my-3">Calculation multipliers</h3>
<ol>
<li class="mb-2" style="font-size: 12px;">
<span id="formulaFootnote">
Simplified formula break-even point: ( [AV1 encoding cost] + [AV1 ingress cost] ) / ( [H.26X CDN delivery cost] - [AV1 CDN delivery cost] )
For the break-even point calculation we calculated the number of views such as:
([views] * [H.26X CDN delivery cost]) + [H.26X encoding cost]
is equal to
([views] * [AV1 CDN delivery cost]) + [H.26X encoding cost] + [AV1 encoding cost]
</span>
</li>
</ol>
Expand Down
19 changes: 6 additions & 13 deletions encoding/av1-break-even-calculator/js/av1-break-even-calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $(function() {

var numberValue = Number(e.target.value);
if (isNaN(numberValue) || numberValue < 0
|| countDecimals(numberValue) > 2) {
|| countDecimals(numberValue) > 4) {
inputEl.addClass('is-invalid');
onInputValue(NaN);
return;
Expand All @@ -48,21 +48,20 @@ $(function() {
(function initAv1Form() {
// form values for calculation
let encodingCostPerMinute = 0.02;
let ingressCostPerGb = 0.00;
let egressCostPerGb = 0.04;

let numberOfStreamsUhd = 2;
let numberOfStreamsHd = 3;
let numberOfStreamsSd = 4;

const multiplierStreamUhd = 4;
const multiplierStreamHd = 2;
const multiplierStreamSd = 1;
const multiplierTechPerTitle = 1.1;
const multiplierTech3Pass = 2; // Multipass
const multiplierCodecAv1 = 10;

// streams/renditions
const ingressCostPerGb = 0.00;
const improvementsAv1H264 = 0.5; // 50%
const improvementsAv1H265 = 0.7; // 30%
const mbpsH264Uhd = 12;
Expand All @@ -82,7 +81,7 @@ $(function() {
+ numberOfStreamsHd * multiplierStreamHd
+ numberOfStreamsSd * multiplierStreamSd;
const encodingCostPerMinuteAv1 = encodingCostPerMinute * multiplierStreamComposition
* multiplierTech3Pass * multiplierTechPerTitle * multiplierCodecAv1;
* multiplierTech3Pass * multiplierCodecAv1;

// all stream bandwidth
const multiplierStreamCompositionMbps = numberOfStreamsUhd * mbpsH264Uhd
Expand Down Expand Up @@ -121,12 +120,6 @@ $(function() {
calculateBreakEvenPoints();
}));

$('input#ingressCostPerGb', formElement).val(ingressCostPerGb)
.on('input', inputEventHandler((value) => {
ingressCostPerGb = value;
calculateBreakEvenPoints();
}));

$('input#egressCostPerGb', formElement).val(egressCostPerGb)
.on('input', inputEventHandler((value) => {
egressCostPerGb = value;
Expand Down

0 comments on commit 7668358

Please sign in to comment.