2.2.12 • Published 6 months ago

@observertc/samples-encoder v2.2.12

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

ObserveRTC Library for Encoding Samples

Monitor components provide samples in the ObserveRTC stack. This library is written to encode the provided transport and use as little bandwidth as possible for transportation. It achieves this by applying the following methods:

  1. Calculate the difference between the last and the current sample.
  2. Convert the delta sample to a Protobuf sample.

API

SamplesEncoder

import { SamplesEncoder } from "@observertc/samples-encoder";

const encoder = new SamplesEncoder();
const encodedSample = encoder.encodeToBase64(samples);
// or if you want to Uint8Array
const encodedSampleArray = encoder.encodeToBytes(samples);

// send the encoded sample

ClientSampleEncoder

import { ClientSampleEncoder } from "@observertc/samples-encoder";

const encoder = new ClientSampleEncoder();
clientMonitor.on("sample-created", ({ clientSample }) => {
	const encodedSample = encoder.encodeToBase64(clientSample);
	// or if you want to Uint8Array
	const encodedSampleArray = encoder.encodeToBytes(clientSample);

	// send the encoded sample
});

SfuSampleEncoder

import { SfuSampleEncoder } from "@observertc/samples-encoder";

const encoder = new SfuSampleEncoder();
const encodedSample = encoder.encodeToBase64(sfuSample);
// or if you want to Uint8Array
const encodedSampleArray = encoder.encodeToUint8Array(sfuSample);

// send the encoded sample

Performance

ClientSampleEncoder

The following measurements were obtained by executing a test using one SFU and N number of participants joining the same SFU. The sampling and sending period was 5 seconds, the total time for the test was 60 seconds (12 samples). For 2, 3, and 5 participants, the measurements were taken from the last participant who joined the call.

MinMaxMedianAverage
1 participant0.322.270.340.50
2 participants0.734.440.781.08
3 participants0.964.901.061.37
5 participants1.595.741.651.96

The measurements are represent the size of the encoded message in KiloBytes

2.2.12-448fc49.0

8 months ago

2.2.9

10 months ago

2.2.12-5deb2ab.0

8 months ago

2.2.11

8 months ago

2.2.12

6 months ago

2.2.10

8 months ago

2.2.8

10 months ago

2.2.3

12 months ago

2.2.2

12 months ago

2.2.5

12 months ago

2.2.4

12 months ago

2.2.7

10 months ago

2.2.6

11 months ago

2.2.1

12 months ago

2.2.0

1 year ago

2.2.1-c620364.0

1 year ago

2.2.1-42b3979.0

1 year ago

2.2.1-9620b7f.0

1 year ago

2.2.1-a793eea.0

1 year ago

2.2.1-e6b9dfd.0

1 year ago

2.2.1-dbf86fa.0

1 year ago

2.2.1-2ae291d.0

1 year ago