Performance is bad when using gpu-image

tienphi

New Member
I'm using the gpu-image module. In normal case, it runs quite smoothly because (by default ) you don't set the resolution for it, but when I set resolution, the video is quite lagging although the device performance is very good. When I debug, the frame on my device is only 320 x 240, it's really dim. When I add the code as below to set the resolution up to 640 x 360 and expand the local_video_view to see it, I realize a problem of lag, drop frame. The lagging occurs in the local view running on the devices when I publish.

StreamOptions streamOptions = new StreamOptions(streamName);
Constraints constraints = new Constraints(true, true);
VideoConstraints videoConstraints = new VideoConstraints();
videoConstraints.setVideoFps(15);
videoConstraints.setResolution(640,360);
constraints.setVideoConstraints(videoConstraints);
streamOptions.setConstraints(constraints);


I’m testing on devices as below:
  • Samsung galaxy A32 (very laggy)
  • Xiaomi redmi note 8.
  • Vsmart joy 4.
  • Google Pixel 2XL.
An staff also note that:
“Preliminary results: the problem is in gpu-image library itself, its performance drops even on powerful hardware (for example, on Google Pixel 3 and Samsung S10+ publishing FPS drops since 1024x768 and bigger resolutions. So we are refactoring Camera Manager example to make easy to integrate any other filtering library”

Please help me.Thanks!
 

Max

Administrator
Staff member
Good day.
Seems like android-gpuimage library itself has a bad perfomance on any device: the better CPU, the bigger resolution it can handle. So you can integrate any other filtering library. Now in ticket WCS-3339 we working on Camera Manager example to make the integration easier.
 

tienphi

New Member
Can you suggest other filtering library to me, which that more compatible can fix or reduce this lagging problem? Thank you!
 

Max

Administrator
Staff member
Good day.
We've refactored Camera Manager example slightly to make third party filter library integration easier. Actually, you should implement 3 methods: initFilter, applyFilter, destroyFilter. See source code on GitHub and Camera Manager example description.
By default, GPU image library is used, you can use any other library if you find it.
 

Max

Administrator
Staff member
who to use guiImage and texture?
Please clarify:
- what library do you use (with link to GitHub etc)?
- what client SDK do you use (Web, Android, iOS) and what version?
- what WCS build do you use?
Now, there is only GPUImage integration examples in Android and iOS SDK. On Android devices, this library has a bad performance, but on iOS devices it runs perfectly because it's natively developed for iOS. We have not tested other libraries (besause we did not found production-ready alternative to GPUImage yet).
 

gunjansharma

New Member
Exceptionally educational article. truly anticipating understanding more. Jodhpur Escort Much obliged to you for the post. a top-class Best Service Out Call Service gives great and astonishing aggregate contributions with models. You drop by
 
Top