-
Notifications
You must be signed in to change notification settings - Fork 96
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
Low resolution on some Android phones #133
Comments
this partly fixes webrtc-sdk#133. Quick summary: - on lower resolutions, simulcast only sends 2 (or even 1) layer. - The layers are ordered from low to high resolution (downscale factors 4, 2, 1) - previously, when only sending 2 layers (factors 2, 1), the layer with factor 2 was mapped to the layer with factor 4, i.e. scaled down again) - with this patch, the layers are mapped to the correct factor and not scaled down again
Hey, thanks for the report and PR! I'll take a look at this over soon. |
We haven't yet looked into this deeply, but someone mentioned that because the server expected three layers and got only two, the score could be dinged. |
That was me after some more digging 😃 |
|
Hi @davidliu Even though it's not needed anymore, can you elaborate on the layer ordering? I don't see where I change it. The resulting |
@holzgeist looking at it again, I think I just brain-farted and thought it reversed the order. The ordering should be fine. I think we can actually use it actually. I'll need to do a little more digging and testing though |
Hi there,
during development of our app that uses Livekit as the video call framework, we discovered that the video quality is very low on some Android devices. I tracked down at least one bug (and a combination of heuristics combined with some bad luck I guess) in WebRTC, so I'm reporting this here and not in https://github.com/livekit/client-sdk-flutter/, the entry point we use.
The issue
We set the
defaultCameraCaptureOptions
toVideoParametersPresets.h720_43
(i.e.960x720
) with simulcast enabled. On some Android phones, the sent simulcast layers are144x192
and288x384
, even on local network with a local livekit server. This is ~16% of the requested resolution, and definitely not suitable for high quality video conferencing.The deep dive into WebRTC
After ruling out network issues, I started a deep dive into client-sdk-flutter and subsequently into WebRTC itself. Here are my findings (on a Fairphone 5 with Android 13):
[4080x3060, 4000x3000, 4000x2250, 3960x1760, 3840x2160, 3264x2448, 3072x3072, 3060x3060, 2700x1200, 2592x1944, 2048x1536, 1920x1080, 1600x1200, 1440x1080, 1280x960, 1280x720, 1200x1200, 1080x1080, 1024x768, 800x600, 800x480, 720x480, 640x480, 640x360, 352x288, 320x240, 176x144]
Camera2Session: Using capture format: 1024x768@[7.0:30.0]
webrtc/media/base/video_adapter.cc
Lines 234 to 236 in 7ddfc43
2/3
and3/4
as factors for efficiency reasons. 3/4 on each axis reduces the number of overall pixels to 9/16 which is ~56%. The current resolution is now 768x576webrtc/video/config/simulcast.cc
Lines 82 to 106 in 7ddfc43
webrtc/video/config/encoder_stream_factory.cc
Line 358 in 7ddfc43
The solution(s)
max_roundup_rate
in simulcast layer selectionone more thing
With and without the bug fix, livekit server reports a "Good" connection quality for that phone despite being on the same network. On a different phone, that has 960x720 in its native capture formats, layer selection works and connection quality is "Excellent". This is likely a bug in livekits scorer that I will investigate separately. I still wanted to mention it here because it was the reason for my investigations
The text was updated successfully, but these errors were encountered: