Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(setup) increase 4k max bitrates #1038

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 41 additions & 17 deletions spot-client/src/common/utils/meeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,54 @@ export function parseMeetingUrl(url) {
}

/**
* Builds the video constraints based on the preferred aspect ratio and resolution.
* Builds the video constraints and quality objects based on the preferred
* aspect ratio and resolution.
*
* @param {string} preferredResolution - The resolution of choice.
* @returns {Object}
*/
export const getVideoConstraints = preferredResolution => {
export const getVideoSettings = preferredResolution => {
const resolution = Number(preferredResolution);

return {
video: {
aspectRatio: ASPECT_RATIO,
height: {
ideal: resolution,
max: resolution,
min: MIN_HEIGHT
},
width: {
ideal: resolution * ASPECT_RATIO,
max: resolution * ASPECT_RATIO,
min: MIN_HEIGHT * ASPECT_RATIO
},
frameRate: {
max: 30,
min: 15
constraints: {
video: {
aspectRatio: ASPECT_RATIO,
height: {
ideal: resolution,
max: resolution,
min: MIN_HEIGHT
},
width: {
ideal: resolution * ASPECT_RATIO,
max: resolution * ASPECT_RATIO,
min: MIN_HEIGHT * ASPECT_RATIO
},
frameRate: {
max: 30,
min: 15
}
}
},
...Boolean(resolution === 2160) && {
videoQuality: {
maxBitratesVideo: {
H264: {
low: 200000,
standard: 500000,
high: 15000000
},
VP8: {
low: 200000,
standard: 500000,
high: 15000000
},
VP9: {
low: 100000,
standard: 300000,
high: 15000000
}
}
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from 'common/app-state';
import { logger } from 'common/logger';
import { COMMANDS, MESSAGES } from 'common/remote-control';
import { getVideoConstraints, parseMeetingUrl } from 'common/utils';
import { getVideoSettings, parseMeetingUrl } from 'common/utils';
import bindAll from 'lodash.bindall';
import React from 'react';
import { connect } from 'react-redux';
Expand Down Expand Up @@ -130,7 +130,7 @@ export class JitsiMeetingFrame extends AbstractMeetingFrame {
configOverwrite: {
_desktopSharingSourceDevice: this.props.screenshareDevice,
...Boolean(this.props.preferredResolution) && {
constraints: getVideoConstraints(this.props.preferredResolution)
...getVideoSettings(this.props.preferredResolution)
},
desktopSharingFrameRate: {
max: this.props.maxDesktopSharingFramerate,
Expand Down