-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 2c47490 🚀
- Loading branch information
Showing
1 changed file
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict'; | ||
|
||
let preferredResolution; | ||
let mediaStream, bitrate = 100000; | ||
let mediaStream, bitrate = 300000; | ||
let stopped = false; | ||
let preferredCodec ="H264"; | ||
let mode = "L1T1"; | ||
|
@@ -59,27 +59,34 @@ function metrics_update(data) { | |
|
||
function metrics_report() { | ||
metrics.all.sort((a, b) => { | ||
return (100000 * (a.mediaTime - b.mediaTime) + a.output - b.output); | ||
return (100000 * (b.captureTime - a.captureTime) + b.output - a.output); | ||
}); | ||
//addToEventLog('Metrics dump: ' + JSON.stringify(metrics.all)); | ||
const len = metrics.all.length; | ||
let j = 0; | ||
if (len < 2) return; | ||
for (let i = 0; i < len ; i++ ) { | ||
if (metrics.all[i].output == 1) { | ||
const frameno = metrics.all[i].presentedFrames; | ||
const g2g = metrics.all[i].expectedDisplayTime - metrics.all[i-1].captureTime; | ||
const fps = metrics.all[i].fps; | ||
const elapsed = metrics.all[i].elapsed; | ||
const mediaTime = metrics.all[i].mediaTime; | ||
const captureTime = metrics.all[i-1].captureTime; | ||
const captureTime = metrics.all[i].captureTime; | ||
const expectedDisplayTime = metrics.all[i].expectedDisplayTime; | ||
const delay = metrics.all[i].expectedDisplayTime - metrics.all[i-1].expectedDisplayTime; | ||
const processingDuration = metrics.all[i].processingDuration; | ||
const receiveTime = metrics.all[i].receiveTime; | ||
const rtpTimestamp = metrics.all[i].rtpTimestamp; | ||
const g2g = Math.max(0, expectedDisplayTime - captureTime); | ||
const data = [frameno, g2g]; | ||
const info = {frameno: frameno, g2g: g2g, mediaTime: mediaTime, captureTime: captureTime, expectedDisplayTime: expectedDisplayTime, delay: delay}; | ||
const info = {frameno: frameno, elapsed: elapsed, g2g: g2g, captureTime: captureTime, expectedDisplayTime: expectedDisplayTime, | ||
processingDuration: processingDuration, fps: fps, mediaTime: mediaTime, rtpTimestamp: rtpTimestamp, receiveTime: receiveTime}; | ||
e2e.all.push(data); | ||
display_metrics.all.push(info); | ||
} | ||
} | ||
// addToEventLog('Data dump: ' + JSON.stringify(e2e.all)); | ||
//addToEventLog('E2E Data dump: ' + JSON.stringify(e2e.all)); | ||
//addToEventLog('Output Data dump: ' + JSON.stringify(display_metrics.all)); | ||
return { | ||
count: e2e.all.length | ||
count: metrics.all.length | ||
}; | ||
} | ||
|
||
|
@@ -387,13 +394,14 @@ document.addEventListener('DOMContentLoaded', async function(event) { | |
|
||
switch(preferredCodec){ | ||
case "H264": | ||
config.codec = "avc1.42002A"; // baseline profile, level 4.2 | ||
config.codec = "avc1.42002A"; // baseline profile, level 4.2 | ||
/* config.codec = "avc1.640028"; */ | ||
config.avc = { format: "annexb" }; | ||
config.pt = 1; | ||
break; | ||
case "H265": | ||
config.codec = "hvc1.1.6.L123.00"; // Main profile, level 4.1, main Tier | ||
config.codec = "hvc1.1.6.L120.00"; // Main profile, level 4.0, main Tier | ||
// config.codec = "hev1.1.6.L93.B0"; // Main profile, level 3.1, up to 1280 x [email protected] | ||
config.hevc = { format: "annexb" }; | ||
config.pt = 2; | ||
break; | ||
|
@@ -406,7 +414,7 @@ document.addEventListener('DOMContentLoaded', async function(event) { | |
config.pt = 4; | ||
break; | ||
case "AV1": | ||
config.codec = "av01.0.08M.10.0.110.09" // AV1 Main Profile, level 4.0, Main tier, 10-bit content, non-monochrome, with 4:2:0 chroma subsampling | ||
config.codec = "av01.0.08M.08.0.110.09" // AV1 Main Profile, level 4.0, Main tier, 8-bit content, non-monochrome, with 4:2:0 chroma subsampling | ||
config.pt = 5; | ||
break; | ||
} | ||
|