Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Screen Sharing has cropped width #13

Closed
ROBYER1 opened this issue Feb 17, 2021 · 4 comments
Closed

App Screen Sharing has cropped width #13

ROBYER1 opened this issue Feb 17, 2021 · 4 comments

Comments

@ROBYER1
Copy link

ROBYER1 commented Feb 17, 2021

App screen sharing is cropped on the width, it seems some aspect ratios are not supported
This cropping is visible clearly in the documentation even in the example screenshots, so if it is expected behaviour, it means that some areas of the screen are cropped which is inadequate for our use cases which require a proper full-screen view.

https://docs.agora.io/en/Video/screensharing_unity?platform=Unity

Screen shot from docs:
image

This affects:

  1. Advanced Demos App Screen Sharing Sample: https://github.com/AgoraIO/Agora-Unity-Quickstart/tree/master/Advanced-Demos
  2. Screen Sharing Sample: https://github.com/AgoraIO/Agora-Unity-Quickstart/tree/master/API-Example-Unity/Assets/API-Example/screenshare-sample

Using:

-Agora SDK Asset Store Version 3.2.1.72 - February 01, 2021
-Unity 2020.2.4f1
-Windows 10/Mac Big Su
-IOS 14/Android 10

Very simple to replicate:

  1. Use the screen sharing example or the advanced demos App screen share example
  2. Build from Unity to an ipad or phone
  3. Share app screen between the editor and the phone to see the shared screen from the phone is cropped in width

We have been unable to find a fix and the cropping doesn't seem to happen when sharing between Unity Editors, however there is a hint below from another user on the Agora Slack channel that may help:

From Stamblew on Agora Slack:
"the problem was the video dimensions set at the VideoEncoderConfiguration instance. Some dimensions are not accepted by Agora, so it falls back to a default one, I guess, which crops the video frame."

@icywind
Copy link
Collaborator

icywind commented Feb 26, 2021

[copying my comment from Slack]
There are two issues here. First the Web demo has a canvas to show contents with cropping. So it is not a perfect example to examine the issue. Secondly, it is true that the encoder only takes certain resolution ratio. You can verify this by register the OnVideoSizeChanged callback. When the ipad (mine is 1536x2048) starts to run, you can see the callback returns the changed size to 720x1280. Which is the ratio of cropped image you see in Editor.

@plutoless
Copy link
Contributor

plutoless commented Feb 28, 2021

@ROBYER1 and to add the reason why web is cropping the content is because it's using "cover" mode for content hint option. if you use "contain" it will display all content (but you will see black edges)

@ROBYER1
Copy link
Author

ROBYER1 commented Feb 28, 2021

@ROBYER1 and to add the reason why web is cropping the content is because it's using "cover" mode for content hint option. if you use "contain" it will display all content (but you will see black edges)

This doesn't apply to me I am using Unity Editor and a built app on IOS/Android, I can see the raw exact video feed coming in and it is cropped as @icywind mentioned.

What you mention with the image fitting is a different problem that can be easily fixed.

@icywind
Copy link
Collaborator

icywind commented Apr 30, 2021

Rob, I've updated the Adv. Demo+ with fall back dimension to avoid cropping.

@icywind icywind closed this as completed Apr 30, 2021
HugoChaan pushed a commit that referenced this issue Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants