0

While we are implementing a broadcast app using GPUImage we encounter a performance problem. When I was trying to adding a CAEmitterLayer on top of the camera view to implement effect as the image shows, the camera started to drop frames.

enter image description here

What our app does is to broadcast and record locally simultaneously. How can I find the reason and also is there any solution to solve this performance problem?

Hidde
  • 11,493
  • 8
  • 43
  • 68
Xue Li
  • 1

1 Answers1

0

First you could use time profiler from instruments to localize what causes the performance problem. From that point on the solution depends on what causes the problem so without knowing that we can't say much really.

Jelly
  • 4,522
  • 6
  • 26
  • 42
  • I did it in the instruments but cannot tell much from the result. The CPU is quite uneven. Do you have any suggestions about where should I focus to find the bottleneck,(I searched about the usage of instruments of measuring graphics performance, and only got the official documents which tells to use Core Animation, OpenGL ES Activity, ... but not very detailed), thanks a lot! – Xue Li Apr 15 '16 at 06:39
  • Use ***Time profiler*** to check which methods take a long time. And there should be your problem. – Jelly Apr 15 '16 at 06:45
  • I used Time Profiler to run the app when it had the emitter layer and dropped frames, and also when without the emitter layer, but the functions costing most time seems to be the same, both are [GPUImageVideoCamera processVideoSampleBuffer:sampleBuffer] and [GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:rotatedImageBufferWidth height:rotatedImageBufferHeight time:currentTime]. Still cannot figure out what's the true problem. – Xue Li Apr 18 '16 at 03:13
  • This means that those methods affect your performance. Either they take too long to execute or they are called too many times. My guess is that they take too long, you might give them high resolution images which could take too much time to process. – Jelly Apr 18 '16 at 07:16
  • They do take very long time and the camera images we process are as high as 720P, but that is our main job. – Xue Li Apr 19 '16 at 01:56