Skip to content

Commit 6b46228

Browse files
bandwidth reduction changes
1 parent 4400eb0 commit 6b46228

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

modules/RTC/JitsiRemoteTrack.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const logger = getLogger('rtc:JitsiRemoteTrack');
2121
const ort = require('onnxruntime-web');
2222

2323
ort.env.wasm.wasmPaths = '/libs/dist/';
24+
ort.env.wasm.numThreads = 1;
2425

2526
let ttfmTrackerAudioAttached = false;
2627
let ttfmTrackerVideoAttached = false;
@@ -31,9 +32,15 @@ export let decodingSession = null;
3132
*/
3233
async function loadDecoder() {
3334
try {
34-
decodingSession = await ort.InferenceSession.create('/libs/models/Decoder.onnx', { freeDimensionOverrides: {
35-
batch: 1,
36-
} });
35+
decodingSession = await ort.InferenceSession.create('/libs/models/Decoder.onnx',
36+
{
37+
executionProviders: [ 'wasm' ],
38+
freeDimensionOverrides: {
39+
batch: 1,
40+
}
41+
}
42+
);
43+
console.info('Decoder model has been loaded');
3744
} catch (error) {
3845
console.error('Decoder model could not be loaded!: ', error);
3946
}
@@ -442,11 +449,6 @@ export default class JitsiRemoteTrack extends JitsiTrack {
442449
* @param {*} videoTrack
443450
* @param {*} canvasDecoded
444451
*/
445-
applyONNXDecoder(videoTrack, canvasDecoded, muted); /**
446-
* Does the decoding phase of the incoming streams
447-
* @param {*} videoTrack
448-
* @param {*} canvasDecoded
449-
*/
450452
applyONNXDecoder(videoTrack, canvasDecoded, muted) {
451453
// Frame-grabber to catch frames from the incoming stream
452454
const imageCapture = new ImageCapture(videoTrack);
@@ -464,6 +466,8 @@ export default class JitsiRemoteTrack extends JitsiTrack {
464466
// Capturing a frame and painting it into the aux canvas
465467
const frame = await imageCapture.grabFrame();
466468
// Getting the current size of the incoming stream
469+
// const width = videoTrack.getSettings().width;
470+
// const height = videoTrack.getSettings().height;
467471
const width = frame.width;
468472
const height = frame.height;
469473

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lib-jitsi-meet",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"description": "JS library for accessing Jitsi server side deployments",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)