opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
211 stars 169 forks source link

Video quality optimization bugs in Android #398

Closed PratikDA closed 1 year ago

PratikDA commented 3 years ago

Issue: 1) Following methods not show any effect: a) setPreferredResolution(new VideoUtils.Size(width, height)) on subscriber object which was set to 240x320 but still giving resolution of 480x640 b) setPreferredFrameRate(frameRate) on subscriber object where frameRate i tested were 1,7,15,30 but was not having any effect as i was not able to guess any difference Similarly, If i don't set the preferred values, still it was giving the same quality in different network bandwidth without autoscaling though sometimes the video was switched off and only audio was published due to low bandwidth

2) using setVideoStatsListener on publisher object works for first time but if i create a new publisher object and set the same listener as i need to change video quality which needs to be set while building the publisher object, it doesn't work.

3) setStyle(BaseVideoRenderer.STYLE_VIDEO_FILL, BaseVideoRenderer.STYLE_VIDEO_SCALE) on publisher object enables setting the Publisher.CameraCaptureResolution.LOW,MEDIUM AND HIGH but if i use setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL), the video quality published doesn't honor the low, medium and high flags set on .resolution(res) in builder for publisher android.

I have tested on multiple versions including 2.19.1 i.e. com.opentok.android:opentok-android-sdk:2.19.1

v-kpheng commented 1 year ago

@PratikDA, thanks for filing this issue. A lot has changed since 2.19. Can you please try using the latest version of the SDK?

Regarding setPreferredResolution and setPreferredFrameRate, can you provide a sessionId? Those methods are intended for routed sessions as well as other constraints. For example, https://tokbox.com/developer/sdks/android/reference/com/opentok/android/SubscriberKit.html#setPreferredResolution-com.opentok.android.VideoUtils.Size-.

Closing, this since version of the SDK is no longer supported.