Constraints ignored after update

Hi,
we use custom constraints (smaller width, aspect ratio 4/3) in order to save some bandwidth:

 constraints: {
    "video": {
        "height": {
            "ideal": 720,
            "max": 720,
            "min": 240
        },
        "width": {
            "ideal": 960,
            "max": 960,
            "min": 320
        }
    }

These work in our production environment, which is still running version 2.0.5390.
Console Output:

Got media constraints:  {"video":{"height":{"ideal":720,"max":720,"min":240},"width":{"ideal":960,"max":960,"min":320},

After updating our development to version 2.0.5870, these constraints do not seem respected anymore:

Got media constraints:  {"video":{"height":{"ideal":720},"width":{"ideal":1280},"facingMode":"user"}

The same console output can be seen on meet.jit.si.

Is this a bug or a misconfiguration?

constraints: {
    video: {
        aspectRatio: 4 / 3,
        height: {
            ...
            ...
}

That is not the point.
We used aspectRatio before and it did not work properly across all browsers.
The specification of height and (limited) width did work and, in our case, resulted in a ratio of 4/3.
The important issue is that we want to limit width to 960 in order to save bandwith (compared to 1280).

What does this mean? The constraints here are different from the constraints you’ve stated are enforced in your production environment. Are you saying when you specify the same (original) constraints in your prod environment, they’re somehow being changed to what you’ve highlighted?

I try to specify:
These are our constraints settings in all of our environments:

 constraints: {
    "video": {
        "height": {
            "ideal": 720,
            "max": 720,
            "min": 240
        },
        "width": {
            "ideal": 960,
            "max": 960,
            "min": 320
        }
    }

They were respected in version 2.0.5390.

With version 2.0.5870 they are not respected anymore.
This can be indirectly verified via console output:

Got media constraints:  {"video":{"height":{"ideal":720},"width":{"ideal":1280},"facingMode":"user"}

I’ve just tested this on one of my servers running 2.0.5870-1, and it seems to be working as expect.

Having set the following in config.js:

    constraints: {
      video: {
        height: {
            ideal: 720,
            max: 720,
            min: 180
        },
        width: {
            ideal: 960,
            max: 960,
            min: 320
        },
        frameRate: {
          max: 30,
          min: 5
        },
      }
    },

I see the following in console:

Got media constraints:  {"video":{"height":{"ideal":720,"max":720,"min":180},"width":{"ideal":960,"max":960,"min":320},"frameRate":{"max":30,"min":5},"facingMode":"user"},"audio":{"autoGainControl":true,"echoCancellation":true,"noiseSuppression":true}}

So there’s probably more to your issue than must the version bump?

Works fine on my end as well. Definitely not a bug.

Do you have double quotations in your config file? Maybe this causes the issue

1 Like

Thank you for testing @shawn and @Freddie - seems to be a problem with our configuration.
We will try to find out what causes the issue.

As @emrah mentioned, do you think the double quotes around those properties could be the issue?

Although you said the exact same configuration worked in your previous deployment, I’m wondering if that could be the cause… Maybe, try:

constraints: {
      video: {
        height: {
            ideal: 720,
            max: 720,
            min: 180
        },
        width: {
            ideal: 960,
            max: 960,
            min: 320
        },

Removal of the double quotes does not help.

@shawn, @Freddie, @emrah, thank you so much for your help.
We are trying hard to find the differences in the various config files that are triggering the error, but have had no success so far.
Would it be possible for you to post the configuration of your working setup (config.js, jvb.conf, etc.) here?
That would probably help us a lot in tracking down the cause.

I don’t have access at the moment, but my configs aren’t far off from the vanilla configs.

Can I suggest you try a fresh install in a new instance, and just change the constraints? If that does not take effect, then we can prove that there is something amiss in latest update; and if it does work, then you have yourself a clean config to compare against with extra tweaks muddying the water. Will be a small win either way :slight_smile:

@shawn Indeed we have a “playground” VM running a Vanilla installation of Jitsi. The VM runs Debian 10 “Buster” and the current stable Jitsi packages:

ii  jitsi-meet                      2.0.5870-1                        all          WebRTC JavaScript video conferences
ii  jitsi-meet-prosody              1.0.4985-1                        all          Prosody configuration for Jitsi Meet
ii  jitsi-meet-web                  1.0.4985-1                        all          WebRTC JavaScript video conferences
ii  jitsi-meet-web-config           1.0.4985-1                        all          Configuration for web serving of Jitsi Meet
ii  jitsi-videobridge2              2.1-492-g5edaf7dd-1               all          WebRTC compatible Selective Forwarding Unit (SFU)
ii  jicofo                          1.0-747-1                         all          JItsi Meet COnference FOcus

Same game there. I have added the same constraints in config.js but the setting is not respected according to console output.
The instance is publicly available (https://buster.therapie.de, CAVE: selfsigned cert) so you may take a look at it.

I just noticed that even at https://meet.jit.si the defined constraints seem to be ignored or at least the output has changed (min/max settings are not mentioned anymore):

var config = {
    hosts: {
        domain: 'meet.jit.si',

        muc: 'conference.'+subdomain+'meet.jit.si', // FIXME: use XEP-0030
        focus: 'focus.meet.jit.si',
    },
    disableSimulcast: false,
    resolution: 720,
    constraints: {
        video: {
            height: {
                ideal: 720,
                max: 720,
                min: 180
            },
            width: {
                ideal: 1280,
                max: 1280,
                min: 320
            }
        }
    },

Console output:

Got media constraints:  {"video":{"height":{"ideal":720},"width":{"ideal":1280},"facingMode":"user"},"audio":{"autoGainControl":true,"echoCancellation":true,"noiseSuppression":true}}

What happens if you remove this line?

@shawn , ha! That looks different:

Got media constraints:  {"video":{"height":{"ideal":720,"max":720,"min":240},"width":{"ideal":960,"max":960,"min":320},"facingMode":"user"},"audio":{"autoGainControl":true,"echoCancellation":true,"noiseSuppression":true}}

Why? Is this parameter obsolete?

:man_shrugging:t4: no idea, I’m just a nosy passer by. Visually diffed your config.js against mine and that one stood out.

At least now we known which parameter is causing the issue; makes it easier to take this issue forward.

Absolutely! Many thanks for finding out.

To summarize:

• If resolution is included in the config min and max parameters are ignored

• If resolution is excluded in the config min and max parameters are honored

Is that correct @shawn , @haris ?