Skip to content
Commit 7b4646e5 authored by Daniel Calviño Sánchez's avatar Daniel Calviño Sánchez
Browse files

Fix laggy high resolution videos in Chromium



Chromium does not allow to increase the resolution of a video stream
once the video stream is cloned. If a video stream is requested without
any constraint, the video stream is returned with a resolution around
640x480. Therefore, when Chromium is used the streams needs to be
explicitly requested with a high resolution to be able to increase the
resolution later as needed.

As the requested resolution is a loose constraint the resolution was
requested as 1920x1200 instead of the more common 1920x1080 to try to
cover most cases. However, if a camera does not exactly provide
1920x1200 but 1920x1080 and also an even higher resolution Chromium may
choose to crop and scale that higher resolution video rather than using
the 1920x1080 video.

The problem is that Chromium may choose to do that even if the higher
resolution video has an incredibly low frame rate (for example, Chromium
is able to get 2304x1296 and 2304x1536 videos from the Logitech C920,
but only at 2 FPS). Moreover, it seems that once the stream is cloned
Chromium is not able to then get a lower resolution but higher frame
rate video; it seems to be stuck with the original stream and just scale
it as needed, so the lower frame rate is still kept.

To fix this now the initial stream is requested with both a high
resolution and a high frame rate. This way Chromium needs to balance
both constraints and thus provide a video without the highest resolution
but with an acceptable frame rate.

Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
parent 44ad976b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment