jitsi / lib-jitsi-meet

A low-level JS video API that allows adding a completely custom video experience to web apps.
Apache License 2.0
1.34k stars 1.11k forks source link

Very low video quality if more than 2 users even with `selectParticipant()` #1645

Closed maxirozay closed 3 years ago

maxirozay commented 3 years ago

Description

Issue similar to this https://community.jitsi.org/t/room-selectparticipants-stopped-working-after-update/100238. When I have 2 users the video resolution and frame rate are good. When I have 3 users or more it used to be low resolution and very low frame rate until I used the selectParticipant function. Now even with this function as soon as a third user arrived the video resolution and frame rate drop drastically at a point where we can't see things written in the video and the frame rate seems to be between 1 and 5 fps. I tried updating jitsi and nothing changed. Since it was working a few weeks ago, the only thing that can change without my knowledge is lib-jitsi-meet since I use the CDN https://meet.jit.si/libs/lib-jitsi-meet.min.js.

Current behavior

jitsiRoom.on(
  JitsiMeetJS.events.conference.DOMINANT_SPEAKER_CHANGED,
  userID => {
    jitsiRoom.selectParticipant(userID)
  })

Select the only participant with the mic and cam and if there's more than 2 users the video quality becomes very low.

Expected Behavior

selectParticipant() Should make the selected participant in good quality. I also think that if there's only one or a few video and a good connection there's no reason to have the lowest quality by default.

Possible Solution

I tried changing the resolution in the config.js file on my server (I don't use jitsi-meet from my front-end), on the createLocalTracks options, on setReceiverVideoConstraint, on setSenderVideoConstraint. I also tried setting disableSimulcast to true without success. When there's only 2 users it should be in p2p and works fine so I guess there's some settings to change when using videobridge.

Steps to reproduce

Connect 2 users one with video and see that the video looks good then add a third user, see that the video looks bad then try selectParticipant and it doesn't change anything.

Environment details

Windows 10, brave 1.26.67, chrome 91, firefox 89 android 9 and 10 jitsi-meet 2.0.5390-3
jitsi-meet-prosody 1.0.4628-1 jitsi-meet-turnserver 1.0.4628-1 jitsi-meet-web 1.0.4628-1 jitsi-meet-web-config 1.0.4628-1 jitsi-videobridge2 2.1-416-g2f43d1b4-1 lib-jitsi-meet version 0.7.3

maxirozay commented 3 years ago

If I set disableSimulcast to true in initJitsiConference() instead of in JitsiMeetJS.init() as it should be based on the doc. So I can kind of fix my issue by disabling simulcast but the issue is still there with simulcast.

damencho commented 3 years ago

Please when you have questions or problems use the community forum before opening new issues, thank you.

Simulcast needs time to ramp up, usually, it takes 10-15 seconds, does it change after that period? Do you experience the same using meet.jit.si?

maxirozay commented 3 years ago

@damencho the question wasn't answered for 28 days in the forum and I genuinely think something broke in the last weeks because before I had this issue that I fixed with selectParticipant which isn't working anymore.

I did stayed for minutes to see if the quality is improving, as it does need a few seconds with 2 users to get the best quality, but with 3 users it stays in the lowest quality sometime with an acceptable framerate sometime with a very low and laggy framerate. I just tried on meet.jit.si with 3 users on the same laptop and with 3 users on a latop, phone and tablet. When I tried on meet.jit.si the resolution is low but the fps is good on tile view and if I focus on someone the quality is switch between SD and HD.

My internet speed is between 400 and 500 Mbps with a ping between 5 and 10 ms and I'm the only person using my network.

As I said in my last message the doc doesn't seem up to date and maybe there's some settings I could use that are not in the doc or in the wrong function.

jallamsetty1 commented 3 years ago

Do you have your bridge channel set up correctly ? Also are you disabling the new video constraints by any chance by setting useNewBandwidthAllocationStrategy: false in your config.js ?

jallamsetty1 commented 3 years ago

@maxirozay Also, you should try switching over to the new receiver constraints https://github.com/jitsi/lib-jitsi-meet/blob/master/JitsiConference.js#L3486 that gives you more flexibility over what endpoints and what resolutions are being requested from the bridge. You can also refer to https://github.com/jitsi/jitsi-videobridge/blob/master/doc/allocation.md for usage.

maxirozay commented 3 years ago

@jallamsetty1 thank you for your response. I use the default config so I didn't try useNewBandwidthAllocationStrategy: false. I also don't use jitsi-meet, I use my own front-end, so by config.js should I still edit the config.js from jitsi-meet or edit the config sent to JitsiMeetJS.JitsiConnection() with lib-jitsi-meet ?

I'm going to look into your links and try to what you said. For now I disabled simulcast and manage the resolution from the frontend based on who's speaking which is fine but I'll take time to understand better simulcast.

limuzi2231 commented 1 year ago

@maxirozay hi, I encountered the same problem when installing jitsi-meet by docker. Have you solved the problem? Can you show me the method how to solved it? Thank you.

saghul commented 1 year ago

It's likely misconfiguration. Please open a new issue on the Docker repository, this one is 2 years old.

maxirozay commented 1 year ago

@limuzi2231 I think I fixed it by disabling simulcast, now the code has changed and I used this config

confOptions: {
        disableSimulcast: false,
        enableLayerSuspension: true,
        disableThirdPartyRequests: true,
        p2p: {
          enabled: false
        }
 }

for initJitsiConference.

saghul commented 1 year ago

Disabling simulcast is a bad idea, please don't recommend that.