miroslavpejic85 / mirotalkc2c

✨WebRTC - C2C - Real-time cam-2-cam video calls & screen sharing, end-to-end encrypted, to embed in any website with a simple iframe.
https://c2c.mirotalk.com
GNU Affero General Public License v3.0
232 stars 57 forks source link

RFE: configurable video resolution and framerate #6

Closed mlichvar closed 1 year ago

mlichvar commented 1 year ago

It seems the default video constraints are 1280x720@30 and there is an option to set 3840x2160@60. Some computers are too noisy even when encoding at 1280x720 (e.g. firefox not using HW acceleration). It would be nice if the resolution and framerate could be set directly in the UI.

miroslavpejic85 commented 1 year ago

Hello @mlichvar,

I will explain you better the current logic:

    if (config.forceToMaxVideoAndFps) {
        videoConstraints = {
            width: { ideal: 3840 },
            height: { ideal: 2160 },
            frameRate: { ideal: 60 },
        };
    } else {
        videoConstraints = {
            width: { ideal: 1280 },
            height: { ideal: 720 },
            frameRate: { ideal: 30 },
        };
    }

1280 x 720 and 30fps as the default and the ideal one. That means, if your webcam or screen support this default resolution - fps, it will be set, if not, it takes the supported one started from 320x240, it can be 640x480 15fps and so on, up max to 1280 x 720 and 30 fps.

3840 x 2160 and 60fps if enabled is the ideal one. The same logic, if you have a webcam or screen with 4k resolution and support 60fps, it will be set, if not, the maximum that the webcam or screen support, that start from 320x240 up to 3840 x 2160 and 60fps. For example, for the webcam or screen 2k - 30fps MiroTalk will set 2560 x 1440 - 30fps.

I can add the option to set video resolution and fps in the settings, as in other MiroTalk versions, but here, as Cam 2 Cam, with the current logic i described before, it ensuring an optimal video resolution and fps.

Thank you.

miroslavpejic85 commented 1 year ago

Done, now you can set also the video quality and fps in the settings or use the Best quality functionality described before.

mirotalk-c2c-video-quality-fps
mlichvar commented 1 year ago

This is great. Thanks!