Fix "zoom" effect with some cameras when changing the resolution #10848
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is already ready for review, but it is marked as a draft to prevent merging it; @SystemKeeper will take care of that when/if needed :-)
When the video track resolution is changed the browser may crop and downscale the camera output to satisfy the requested constraints (
resizeMode: "crop-and-scale"
). However, in some cameras this causes an annoying "zoom" effect when changing between resolutions (it might be caused by the original source being shown for a split second before being cropped and downscaled, which may change the aspect ratio, although the reason is not fully clear). To prevent that, now the browser is asked to provide the camera output as is (although respecting the given constraints), without further adjustments.Note that the resize mode is not enforced, though. The browser may still crop and scale the camera output if it is not possible to get a native track in the requested resolution range.
The problem (and therefore the steps below) can be reproduced at least with Logitech C920 and integrated Macbook camera, but not with others; nevertheless it should not adversely affect those cameras where the problem did not initially happen (but that should be thoroughly tested ;-) ).
How to test
sentVideoQualityThrottler
in the browser console by adding something like the following to src/utils/webtc/index.js:Result with this pull request
There is no visible "zoom" (although there could be a tone change, which seems to happen due to the lighting adjustment made by the camera when restarting)
Request without this pull request
The image might "jump" when the resolution is adjusted
The actual constraints set in the video track can be checked by running the following in the browser console: