open-webrtc-toolkit / owt-client-native

Open WebRTC Toolkit client SDK for native Windows/Linux/iOS applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
384 stars 180 forks source link

Keeping a steady resolution (RTC configuration: enableCpuOveruseDetection?) #707

Closed dilldilldill closed 1 year ago

dilldilldill commented 1 year ago

Hello there,

On the android implementation of the OWT client I found a option enableCpuOveruseDetection via a slackoverflow answer, which, when turned off, stops the stream from degrading its resolution. The iOS implementation does not seem to offer anything similar, at least I can't find it at the moment. A different answer mentions degradation preferences which I also fail to find in the OWT iOS implementation.

Is there any possiblity to stop OWT degrading and keeping the resolution?

PonyHugger commented 1 year ago

+1

jianjunz commented 1 year ago

Hi,

RTCDegradationPreference is the standard way to set degradation preferences. It's defined in RTCRtpParameters.h.

PonyHugger commented 1 year ago

thank you very much! i'll give it a try!

dilldilldill commented 1 year ago

RTCDegradationPreference is the standard way to set degradation preferences. It's defined in RTCRtpParameters.h.

RTCRtpParameters only seems to be exposed via RTCPeerConnection -> senders RTCRtpSender -> parameters RTCRtpParameters.

But how do I get access to the RTCPeerConnection? The peer connection is managed by and hidden behind the OWTConferenceClient as far as I understand.

So how would you suggest to set RTCRtpParameters?

Thanks for your help!

PonyHugger commented 1 year ago

@jianjunz unfortunately, RTCPeerConnection is not reachable, just like @dilldilldill has mentioned in his or her last post...

rouzbeh-abadi commented 1 year ago

I am facing the same issue. To add encoding parameters to the video sender, we need access to the RTCRtpSender object, which is currently unavailable. Modifying OWTConferenceClient.mm, its header, and related files might be a solution, but it requires a deep understanding of both OWT and WebRTC projects. Considering it has been about two years, a respectful suggestion to the contributors would be to update the OWT project to address compatibility and functionality concerns.

PonyHugger commented 1 year ago

...still no solution... :cry:

PonyHugger commented 1 year ago

Hi everyone,

we are still not able to edit the degradation preference.

@dilldilldill and @rouzbeh-abadi were you able to solve it?

@jianjunz do you have an idea?

dilldilldill commented 1 year ago

To prevent resolution degradation rebuild OWT after you changed the file src/third_party/webrtc/video/adaption/video_stream_encoder_resource_manager.cc and make IsResolutionScalingEnabled return false and IsFramerateScalingEnabled return true.

bool IsResolutionScalingEnabled(DegradationPreference degradation_preference) {
  return false;
}

bool IsFramerateScalingEnabled(DegradationPreference degradation_preference) {
  return true;
}