Open linhlq58 opened 3 years ago
Hello,
Display mode support any resolution. If you select a resolution different of device screen MediaProjectionManager scale it for you.
@pedroSG94 Yes, but the output video will not be at fullscreen. I want a fullscreen video without any black spaces. Are there any options to trim screen before streaming? Or a way to fit screen width and auto scale screen height?
This is not a bug, I tried record screen with native oneplus app and the result is the same (black spaces). I suspect that mediaprojection api is doing it (I mean it is already full screen). We can apply a filter to crop it. Knowning it the question is:
I will check it another time to comfirm all
Okay 👯 Please let me know when you have a solution. I really need your help.
Ok, I found a way to fit screen but this produce image distortion to adapt it (it is normal you can't fit without distortion using different resolutions). Go to this line and set width / height to screen device resolution: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/DisplayBase.java#L392 Also in this line: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/java/com/pedro/encoder/input/gl/render/CameraRender.java#L68
@pedroSG94 Thank you for your solution. I tried and it worked. But it's a bad UX in a livestream app if images are distorted. Is there anyway to fit screen without distortion by cutting the top edge or bottom edge of the screen while streaming?
Yes, that is possible but, for now, I will mark it as feature because it will take time to develop properly.
Hi @linhlq58, do you have any solution for this?
I'm working on an app which is live-streaming on Facebook using Display RTMP. But I noticed that the output video don't fit the screen, there are black spaces on 2 sides. I think this issue happens when screen size of device does not match with resolution (720 x1080).
Is there any way to capture only a part of screen and stream to Facebook to avoid this issue?