steep-balloon-41261
08/21/2023, 6:53 AMfancy-wire-61616
08/21/2023, 7:03 AMcold-belgium-91163
08/21/2023, 7:09 AMcold-belgium-91163
08/21/2023, 7:11 AMexport function computeVideoEncodings(
isScreenShare: boolean,
width?: number,
height?: number,
options?: TrackPublishOptions,
): RTCRtpEncodingParameters[] {
let videoEncoding: VideoEncoding | undefined = options?.videoEncoding;
if (isScreenShare) {
videoEncoding = options?.screenShareEncoding;
}
const useSimulcast = options?.simulcast;
const scalabilityMode = options?.scalabilityMode;
const videoCodec = options?.videoCodec;
if ((!videoEncoding && !useSimulcast && !scalabilityMode) || !width || !height) {
// when we aren't simulcasting or svc, will need to return a single encoding without
// capping bandwidth. we always require a encoding for dynacast
return [{}];
}
As per the comment it seems when we are not simlucasting then it is not capping the bandwidth(bitrate) . Could it be a reason for reaching the bitratev far beyond mentioned in the presets..fancy-wire-61616
08/21/2023, 7:14 AMcold-belgium-91163
08/21/2023, 7:15 AMfancy-wire-61616
08/21/2023, 7:18 AMcold-belgium-91163
08/21/2023, 7:19 AMfancy-wire-61616
08/21/2023, 7:20 AMcold-belgium-91163
08/21/2023, 7:24 AMfancy-wire-61616
08/21/2023, 7:24 AMcold-belgium-91163
08/21/2023, 7:25 AMcold-belgium-91163
08/21/2023, 9:57 AMcold-belgium-91163
08/21/2023, 9:59 AMcold-belgium-91163
08/21/2023, 11:50 AMexport function videoLayersFromEncodings(
width: number,
height: number,
encodings?: RTCRtpEncodingParameters[],
svc?: boolean,
): VideoLayer[] {
// default to a single layer, HQ
log.debug("//shahdebug2 ",encodings)
if (!encodings) {
log.debug("//shahdebug2 returning single layer")
return [
new VideoLayer({
quality: VideoQuality.HIGH,
width,
height,
bitrate: 0,
ssrc: 0,
}),
];
}
if (svc) {
log.debug("//shahdebug2 ",svc)
// svc layers
/* @ts-ignore */
const encodingSM = encodings[0].scalabilityMode as string;
const sm = new ScalabilityMode(encodingSM);
const layers = [];
for (let i = 0; i < sm.spatial; i += 1) {
layers.push(
new VideoLayer({
quality: VideoQuality.HIGH - i,
width: Math.ceil(width / 2 ** i),
height: Math.ceil(height / 2 ** i),
bitrate: encodings[0].maxBitrate ? Math.ceil(encodings[0].maxBitrate / 3 ** i) : 0,
ssrc: 0,
}),
);
}
return layers;
}
log.debug("//shahdebug2 not svc")
return encodings.map((encoding) => {
const scale = encoding.scaleResolutionDownBy ?? 1;
let quality = videoQualityForRid(encoding.rid ?? '');
log.debug("shahdebug2 encoding.maxBitrate",encoding.maxBitrate)
log.debug("//shahdebug2 quality",quality)
return new VideoLayer({
quality,
width: Math.ceil(width / scale),
height: Math.ceil(height / scale),
bitrate: encoding.maxBitrate ?? 0,
ssrc: 0,
});
});
}
code is going through last return statement when I am running the call with simulcast off option. I tried printing bitrate as well it is coming as undefined. in console. log... That could be the cause of not honouring the limitation placed on bitrate ?? but this code snippet is same in android code alsocold-belgium-91163
08/22/2023, 6:20 AMfancy-wire-61616
08/22/2023, 6:54 AM