client-sdk-flutter icon indicating copy to clipboard operation
client-sdk-flutter copied to clipboard

[Question] Why my screen sharing is distorted when resize?

Open thaidmfinnick opened this issue 1 year ago • 6 comments

Hi, I have use screen share function recently in my project, but when I share, thumbnail preview and video sharing are distorted, although Livekit Client example is totally fine. I copy same room configuration from example to my project. Below is description video:

https://github.com/livekit/client-sdk-flutter/assets/83997264/43c52d0e-98fc-41ca-a3a6-a6a8a05c36c1

I think it's not from my server side because I test with example is fine. I don't know why it's happened. Below is my configuration:

    RoomOptions(
        adaptiveStream: false,
        dynacast: false,
        defaultAudioPublishOptions: const AudioPublishOptions(
          name: 'custom_audio_track_name',
        ),
        defaultVideoPublishOptions: VideoPublishOptions(
          simulcast: false,
          videoCodec: 'VP8',
          backupVideoCodec: BackupVideoCodec(
            enabled: false,
          ),
        ),
        defaultScreenShareCaptureOptions: const ScreenShareCaptureOptions(
            useiOSBroadcastExtension: true,
            params: VideoParameters(
                dimensions: VideoDimensions(1280, 720),
                encoding: VideoEncoding(
                  maxBitrate: 3 * 1000 * 1000,
                  maxFramerate: 15,
                ))),
        defaultCameraCaptureOptions: CameraCaptureOptions(maxFrameRate: 30),
    ),
        final source = await showDialog<DesktopCapturerSource>(
          context: context,
          builder: (context) => ScreenSelectDialog(),
        );
        if (source == null) {
          setState(() => _isSharingScreen = false);
          context.read<CallProvider>().unhideViewCall();
          return;
        }
        var track = await LocalVideoTrack.createScreenShareTrack(
          ScreenShareCaptureOptions(
            sourceId: source.id,
            maxFrameRate: 15,
          ),
        );

Livekit Client: 2.1.0 Flutter SDK: Flutter 3.16.9

Thank you!

thaidmfinnick avatar Jun 04 '24 04:06 thaidmfinnick

@cloudwebrtc why did you react without replying me 😭

thaidmfinnick avatar Jun 10 '24 10:06 thaidmfinnick

hey @thaidmfinnick , Sorry for the late reply, this should be caused by libwebrtc aligning the height x width to 4 times when collecting the change window. I will check it.

cloudwebrtc avatar Jun 11 '24 01:06 cloudwebrtc

thanks for your response! I will wait.

thaidmfinnick avatar Jun 11 '24 04:06 thaidmfinnick

Hi @cloudwebrtc, any update on this issue? I have updated to Livekit v2.2.0, issue still exists on MacOS.

thaidmfinnick avatar Jul 16 '24 03:07 thaidmfinnick

Quick question, are you using an Intel or Apple silicon Mac? I remember there was a bug in early Intel computers where the capture width/height didn't align, but it seems to have been fixed if I remember correctly.

cloudwebrtc avatar Sep 10 '24 03:09 cloudwebrtc

I'm using Apple silicon Mac (m1 pro 2020). It is still an error (I have updated to livekit 2.2.4)

thaidmfinnick avatar Sep 10 '24 04:09 thaidmfinnick

Hi @cloudwebrtc, any update on this issue?

thaidmfinnick avatar Feb 04 '25 03:02 thaidmfinnick

Hey @cloudwebrtc, just wondering if there’s been any progress?

akbar-a10 avatar Jul 28 '25 09:07 akbar-a10