High CPU usage on rtmp playback #1313
Unanswered
mariosutalo
asked this question in
Q&A
Replies: 2 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, release optimization makes no significant difference. On older devices like Apple TV 4th generation (from 2015) which still supports latest tvOS version, CPU usage is very high (>90%) when bitrate is over 4000kbps. What I have seen from source code is that you use removeSubrange method from Data class in file https://github.com/shogo4405/HaishinKit.swift/blob/main/Sources/RTMP/RTMPNWSocket.swift in listen method and that removeSubrange tends to be cpu intensive. Maybe that could be the reason for high cpu usage. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, we are using your ibrary for RTMP playback, we noticed high CPU usage, especially on older devices. For example on Apple TV 4th generation, when bitrate is higher than 4000kbps cpu usage goes to 100%. On newer devices CPU usage is still high, for example on iphone 12 if bitrate is 9000kbps cpu usage goes over 50%. I have used xcode time profile tool to see details of cpu usage, and 6 or more threads are used to handle reading and processing data from rtmp socket and they use most of CPU. I am attaching screenshot from time profiler. I can send you trace file from profiler too if needed. Thank you in advance for your response.
Beta Was this translation helpful? Give feedback.
All reactions