android-gpuimage icon indicating copy to clipboard operation
android-gpuimage copied to clipboard

Problem when GPUImageView.setImage continuously

Open hoozh opened this issue 10 years ago • 7 comments

Hi everyone

I use GPUImageView to preview camera video frames, because the camera is not standard Android camera, it captures data from USB connection or network stream. so I don't use GPUImage.setUpCamera feature.

my app preview the image frames with GPUImageView.setImage method. I found that if the objects in front of the camera lens move quickly, the image will be splitted.

I think that's because GPUImage rendering is slower than image frames feeding.

Am i right?

How to known if the rendering is finishhed.

normal

splitted

hoozh avatar Nov 13 '14 07:11 hoozh

I also checked if GLSurfaceView is dirty before setImage

hoozh avatar Nov 13 '14 09:11 hoozh

Maybe you need to setup a vsync situation to swap graphics buffers ?

This is how grafika does it:

/**
 * Calls eglSwapBuffers.  Use this to "publish" the current frame.
 *
 * @return false on failure
 */
public boolean swapBuffers(EGLSurface eglSurface) {
    return EGL14.eglSwapBuffers(mEGLDisplay, eglSurface);
}

(referenced from https://github.com/google/grafika/blob/f3c8c3dee60153f471312e21acac8b3a3cddd7dc/src/com/android/grafika/gles/EglCore.java)

JesseScott avatar Nov 20 '14 18:11 JesseScott

I have already done it..but still it lacking how to solve

mPixster avatar Jan 10 '19 11:01 mPixster

Sorry?

JesseScott avatar Jan 10 '19 17:01 JesseScott

The GPUImage and GPUImageFilter apply and draw data from the camera are very slow or if apply group filter. I have modified some class of the GPUImageFilter end render, It runs very fast. If you want I can send to you my source code, I do not post it to here because of code very long.

monxarat avatar Jan 11 '19 05:01 monxarat

do a Pull Request?

JesseScott avatar Jan 11 '19 15:01 JesseScott

@monxarat I also encountered this problem. I was very slow in camera preview at high resolution. How do you solve this problem? Can you send me the source code? Email: [email protected]

gejiashu avatar Mar 11 '20 03:03 gejiashu