steep-balloon-41261
06/19/2023, 7:48 AMbest-parrot-43500
06/19/2023, 8:04 AM[
{
"rid": "q",
"scaleResolutionDownBy": 2,
"maxBitrate": 150000,
"maxFramerate": 3
},
{
"rid": "h",
"scaleResolutionDownBy": 1,
"maxBitrate": 1500000,
"maxFramerate": 15
}
]
RESULT
Playback with resolution: 1341x831px --> “h” layer selected ✅
Playback with resolution: 1260x786px --> “q” layer selected ✅
So the automatic switching between the 2 qualities is working well.
However we don’t want the resolution to go down to half of it as this is not good for sharing text documents. We prefer reducing the FPS down to 2 and keeping the resolution high.
Therefore I have added a override for the simulcast layer for the next approach.best-parrot-43500
06/19/2023, 8:19 AM[
{
"rid": "q",
"scaleResolutionDownBy": 1.2,
"maxBitrate": 250000,
"maxFramerate": 2,
"priority": "medium",
"networkPriority": "medium"
},
{
"rid": "h",
"scaleResolutionDownBy": 1,
"maxBitrate": 1500000,
"maxFramerate": 15
}
]
RESULT
Playback 1 with resolution: 1773x1108px --> “q” layer selected ⚠️
Playback 2 with resolution: 1260x786px --> “q” layer selected ✅
Intuitively I would expect the first playback to go to h
because the window being captured is smaller than the one being played back. However because it’s a high density display the actual content being captured has a higher resolution than the logical pixels.
So staying on the q
level is more or less expected because the playback size is closer to the q
layer than it is to the h
layer which is fine.
Note: Do mind though that the playback sizes are logical px so the real px values should be about double that size as it’s also a high density display. Therefore it would be more or less expected to use the higher quality stream here too.best-parrot-43500
06/19/2023, 8:31 AM[
{
"rid": "q",
"scaleResolutionDownBy": 1.2,
"maxBitrate": 250000,
"maxFramerate": 2
},
{
"rid": "h",
"scaleResolutionDownBy": 1.2,
"maxBitrate": 750000,
"maxFramerate": 6
},
{
"rid": "f",
"scaleResolutionDownBy": 1,
"maxBitrate": 1500000,
"maxFramerate": 15
}
]
RESULT
Playback 1 with resolution: 1773x1108px --> “q” layer selected ❌
Playback 2 with resolution: 1260x786px --> “q” layer selected ✅
Even though the h
quality has the same resolution as the q
quality I never get a switch to h
. No matter what I do it always stays on q
even though my network connection could easily handle it.
I think this must be somehow related to the adaptiveStream
logic being confused because both h
and q
have the same resolution and there is no logic applied to different bitrate or frame rate settings on the layers.best-parrot-43500
06/19/2023, 8:52 AMbest-parrot-43500
06/19/2023, 9:33 AMwindow.devicePixelRatio=2
which will fall back to 1
which I think isn’t quite rightbest-parrot-43500
06/19/2023, 9:37 AMif (devicePixelRatio >= 2)
or are you excluding devices with exactly 2
on purpose?best-parrot-43500
06/20/2023, 6:23 AMbest-parrot-43500
06/20/2023, 6:34 AMif the server is picking a lower layer because of congestionNo it isn’t the server is idling around just waiting for something to do 😄
eager-raincoat-52616
06/20/2023, 6:38 AMadaptiveStream.pixelDensity = 'screen'
? That will use the device pixel ratio directly.best-parrot-43500
06/20/2023, 6:44 AMFor your purposes, have you triedYes I saw that, however I like the reasoning of not going x3 or higher on mobile devices. I might have to do a ``pixelDensity`` check myself and use? That will use the device pixel ratio directly.adaptiveStream.pixelDensity = 'screen'
screen
as long as it’s <=2
.
we chose that >2 value in a recent change to avoid changing default bandwidth consumption in desktop browsersI don’t fully understand that move as a.) on desktop browsers bandwidth usually isn’t that big of a problem and b.) especially on desktop people often share text files / documents which need a high res to be readable.
eager-raincoat-52616
06/20/2023, 6:55 AMbest-parrot-43500
06/20/2023, 6:56 AMpolite-kilobyte-67570
06/26/2023, 12:13 PMpixelDensity
yourself, the only problem remaining is the confusion between lower and higher framerates with the same resolution when using adaptiveStream, right?best-parrot-43500
06/26/2023, 12:18 PMif (devicePixelRatio >= 2)
over if (devicePixelRatio > 2)
polite-kilobyte-67570
06/26/2023, 12:25 PMbest-parrot-43500
06/26/2023, 12:30 PMThis was a conscious decision in order to not alter the previous default behavior in unexpected ways for desktop devicesOkay, I can fully understand that. Unexpected behavior / breaking change management is a huge topic and I fully understand your more defensive stance there.
best-parrot-43500
06/30/2023, 8:08 AMpolite-kilobyte-67570
06/30/2023, 12:45 PMscreenShareSimulcastLayers: [ScreenSharePresets.h720],
screenShareEncoding: ScreenSharePresets.h1080.encoding
in your options should result in two spatial layers with three temporal layers each.
If you were to specify 16 as the original framerate, the other temporal layers would have 8 and 4 respectively.best-parrot-43500
06/30/2023, 1:54 PMfancy-wire-61616
06/30/2023, 2:00 PMbest-parrot-43500
06/30/2023, 2:02 PMpolite-kilobyte-67570
07/03/2023, 3:34 PMbest-parrot-43500
07/04/2023, 6:07 AMbest-parrot-43500
07/04/2023, 11:00 AMpolite-kilobyte-67570
07/04/2023, 1:40 PMbest-parrot-43500
07/04/2023, 2:31 PMbest-parrot-43500
09/04/2023, 2:45 PMadaptive screen video dimension calculation
implementation.
I’ve created an issue on GitHub.
Do you want me to find the right spot and create a PR?polite-kilobyte-67570
09/04/2023, 2:49 PMbest-parrot-43500
09/04/2023, 2:50 PM1.12.3
best-parrot-43500
09/04/2023, 2:50 PM1.13.2
best-parrot-43500
09/04/2023, 2:57 PMbest-parrot-43500
09/04/2023, 2:58 PMpolite-kilobyte-67570
09/04/2023, 3:09 PM