MasayukiSuda / GPUVideo-android

This library apply video filter on generate an Mp4 and on ExoPlayer video and Video Recording with Camera2.
MIT License
658 stars 179 forks source link

issue on saving #17

Open jy617lee opened 5 years ago

jy617lee commented 5 years ago

Hi, Thank you for this amazing library!

However, I just run sample app of this project, and found that if I follow the flow below, causes error. movie preview --> select filter(bilateral_blur/box_blur/brightness etc) --> touch save button

    Process: com.daasuu.gpuvideoandroid, PID: 12432
    java.lang.IllegalStateException: Could not get attrib or uniform location for center
        at com.daasuu.gpuv.egl.filter.GlFilter.getHandle(GlFilter.java:153)
        at com.daasuu.gpuv.egl.filter.GlBulgeDistortionFilter.onDraw(GlBulgeDistortionFilter.java:77)
        at com.daasuu.gpuv.egl.filter.GlFilter.draw(GlFilter.java:121)
        at com.daasuu.gpuv.player.GPUPlayerRenderer.onDrawFrame(GPUPlayerRenderer.java:162)
        at com.daasuu.gpuv.egl.GlFrameBufferObjectRenderer.onDrawFrame(GlFrameBufferObjectRenderer.java:58)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)

These are the error logs, and this is caused because below two methods returns -1

GLES20.glGetAttribLocation(program, name);
GLES20.glGetUniformLocation(program, name);

Do you have any idea that I can fix this issue?

jy617lee commented 5 years ago

I found how to resolve this! I don't know why, but if I delete below code in Glfilter.java (release()), it works!

handleMap.clear();

Jobeeapk commented 5 years ago

Hi. I have the same issue. How to edit this code when I use library as dependency? PS: Problem seems to be solved. I'm creating new GLFilter object for generate video. Previously I'm was using same filter which was used to add filter to preview.

MasayukiSuda commented 5 years ago

Thank you for a good discussion.

BilalAsif25 commented 3 years ago

@jy617lee Hi, does it have any impact on the app, i mean any new crashes by commenting this handleMap.clear();

cuk2dn95 commented 2 years ago

Hi. I have the same issue. How to edit this code when I use library as dependency? PS: Problem seems to be solved. I'm creating new GLFilter object for generate video. Previously I'm was using same filter which was used to add filter to preview.

Thanks you, you save my day