element-call icon indicating copy to clipboard operation
element-call copied to clipboard

Selected video resolution often not that great (EC defaults lower than livekit defaults)

Open spaetz opened this issue 8 months ago • 3 comments

Steps to reproduce

I start by creating Element Calls between myself. The wifi or LAN connection are good, the SFU is not saturated at all. This is current EXA (25.3.4) and Element web (1.11.96), both using the EC widget v0.9 (either integrated or at call.element.io). My SFU is version 1.8.4.

Outcome

The resolution that EXA chose was 180x320 and it appeared quite blocky in Element-Web, in other calls I have seen even way worse resolutions though. I have submitted a rageshake (send feedback within Element Call) just some time ago with the following text:

Good quality network connection, mobile chose 180x320 pixel video (EXA EC v0.9). SFU 1.8.4
I have never switched video sources so far.
For Florian.

Turning the camera on and off seemed to often make the situation a bit better (it started out low and switched to a somewhat higher resolution shortly after), switching to front-side camera and back-sid did not help at all (but it also did not make matters worse).

The Element-Web webcam on the other hand did send a 720x1280 resolution. (switch camera off and on again in EC will lead not always to the same resolutions being picked though). So, it is possible to have higher-resolution calls.

Is livekit erring on the low-quality side of things here? Are there livekit knobs that I can turn. It is a stock installation basically.

Operating system

EXA and EW (Firefox v137/Linux)

Browser information

No response

URL for webapp

integrated v0.9 and call.element.io (v0.9)

Will you send logs?

Yes

spaetz avatar Apr 04 '25 07:04 spaetz

NOte, the rage shake was sent from Desktop, which sent a good quality resolution. I am not sure if that matters or if I should have send from EXA (where the Feedback option did not seem to be visible for the EC widget)

spaetz avatar Apr 04 '25 07:04 spaetz

element-call/src/livekit/options.ts says:

simulcast: true,
 videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360] as VideoPreset[],
 screenShareEncoding: ScreenSharePresets.h1080fps30.encoding,

so, it is offering only h180 and h360 as presets by default, perhaps could add hd or qhd too? https://docs.livekit.io/reference/client-sdk-js/modules/videopresets.html

This is in line with the observation that screen sharing generally has a way better quality.

spaetz avatar Apr 04 '25 07:04 spaetz

Last observation: The standard livekit docs on this topic say:

videoSimulcastLayers: [VideoPreset]

custom video simulcast layers for camera tracks, defaults to h180, h360, h540 You can specify up to two custom layers that will be used instead of the LiveKit default layers. Note: the layers need to be ordered from lowest to highest quality

By using [VideoPresets.h180, VideoPresets.h360] in element-call, you are artifically limiting the quality below the livekit defaults as we are missing out at least h540. Given that livekit seems to only publish those streams that are actually consumed, it seems not necessary to artificially limit our resolution and quality that we are offering here.

That having said, I know nothing about livekit and EC and defer herewith to the experts :-).

spaetz avatar Apr 04 '25 08:04 spaetz