-
Notifications
You must be signed in to change notification settings - Fork 412
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
High CPU usage in iphone5 #8
Comments
I'm in the same boat as you, i have tried several guides and they all seem to not build correctly. |
Originally, I doubt the high fps (up to 44 or higher) can be the reason. Finally I feel disappointed when I try to lower the frame rate using the codes below. The CPU usage still goes to 120% or even higher!
However, there is some evidence that the renderer can be the cause due to the following site: https://perch.co/blog/perchrtc-custom-webrtc-rendering/ I would give a try if there is any progress and share with you guys. |
i have decided to use opentok, their library works perfect for webrtc, but you have to go through them. |
pochuang, |
Finally, I found that the AVCaptureSession could be the reason why my iphone is burning! Before this adjustment, the cpu usage is always 120% or higher, but after this it drops down to 70%! This is a very huge change although it's not a very great solution. The magic is to set sessionPreset to low like this:
#if !TARGET_IPHONE_SIMULATOR && TARGET_OS_IPHONE I am still working on this for a better solution. If you have any idea here, please let me know. |
Please make a pull request for more details, what are values your self.maxHeight, self.minWidth etc..? The values is important and affect on a performance of CPU. |
The accepted values are listed below:
The minWidth and minHeight do not work, so I modified it like this:
And the sessionPreset part like this:
WebRTC will change sessionPreset due to your device's resolution at first. That will make your video more clear but become heavy to CPU. You may take a look at the source code downloaded from google.
The video resolution and frame rate you received from others will also affect CPU in iPhone. For me, I reduce it to 640x480. Now the CPU usage is down to 58% or a little higher than 60%. Not pretty satisfying compared to Android's (the CPU usage is 30% only!) but is workable for now. By the way, It will take a long time to change sessionPresent when your captureSession is already running. For my situation, I need to stop it temporarily and start it latter after making changes. |
hi all. |
is this problem fixed in the newest version? Or do we still need to make changes manually? |
Thanks for your kindly sharing, it really saves me hours; however, I found that the library runs with very high CPU usage under iphone 5 models. The phone will become very hot after some minutes with 140% CPU usage. It there any way to improve this? By the way, I can not get the webrtc codes compiled by myself. Is there any guides to correctly build webrtc in mac?
The text was updated successfully, but these errors were encountered: