From 0eb283b75aad9767213b3827f02dee735c7573fb Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sun, 8 Dec 2024 18:02:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(frontend)=20enable=20adaptive=20st?= =?UTF-8?q?ream=20optimizations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adaptive stream is a key optimization in large room. Enabled adaptive stream to automatically manage the quality of subscribed video tracks, optimizing for bandwidth and CPU usage. When video elements are visible, it adjusts the resolution based on the size of the largest visible element. If no video elements are visible, it temporarily pauses the track until they are visible again. Additionally, introduced support for custom pixel density, which defaults to `2` for high-density screens (devicePixelRatio ≥ 3) or `1` for standard screens. Setting it to `screen` allows the pixel density to match the actual screen's devicePixelRatio, optimizing video clarity on ultra-high-definition displays. This ensures a balance between streaming quality and resource consumption. This might also significantly increase the bandwidth consumed by people streaming on high definition screens. It needs to be battle tested. OpenTalk uses a adaptiveStream equals true, while LiveKit demo app uses 'screen' value. I followed OpenTalk choice, I was scared 'screen' value creates performance issues for user with high resolution screen in poor network conditions. --- src/frontend/src/features/rooms/components/Conference.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frontend/src/features/rooms/components/Conference.tsx b/src/frontend/src/features/rooms/components/Conference.tsx index a4ef949a..394102c0 100644 --- a/src/frontend/src/features/rooms/components/Conference.tsx +++ b/src/frontend/src/features/rooms/components/Conference.tsx @@ -65,6 +65,7 @@ export const Conference = ({ const roomOptions = useMemo((): RoomOptions => { return { + adaptiveStream: true, publishDefaults: { videoCodec: 'vp9', },