MasayukiSuda / GPUVideo-android

This library apply video filter on generate an Mp4 and on ExoPlayer video and Video Recording with Camera2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to save video after applying effects

aahanverma00710 opened this issue · comments

W/System.err: java.lang.IllegalStateException: Could not get attrib or uniform location for oTexture
at com.daasuu.gpuv.egl.filter.GlFilter.getHandle(GlFilter.java:153)
at com.app.feedgoals.widget.CustomOverlayFilter.onDraw(CustomOverlayFilter.java:82)
at com.daasuu.gpuv.egl.filter.GlFilter.draw(GlFilter.java:121)
at com.daasuu.gpuv.egl.filter.GlFilterGroup.draw(GlFilterGroup.java:102)
at com.daasuu.gpuv.composer.DecoderSurface.drawImage(DecoderSurface.java:286)
W/System.err: at com.daasuu.gpuv.composer.VideoComposer.drainDecoder(VideoComposer.java:195)
at com.daasuu.gpuv.composer.VideoComposer.stepPipeline(VideoComposer.java:109)
at com.daasuu.gpuv.composer.GPUMp4ComposerEngine.runPipelines(GPUMp4ComposerEngine.java:170)
at com.daasuu.gpuv.composer.GPUMp4ComposerEngine.compose(GPUMp4ComposerEngine.java:113)
at com.daasuu.gpuv.composer.GPUMp4Composer$1.run(GPUMp4Composer.java:188)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
This is the error

GPUMp4Composer = GPUMp4Composer(videoURi!!.path, videoPath)
.rotation(Rotation.NORMAL)
.size(1080, 720)
.fillMode(FillMode.PRESERVE_ASPECT_FIT)
.filter(GlFilterGroup(glFilterList))
.mute(false)
.listener(object : GPUMp4Composer.Listener {
override fun onProgress(progress: Double) {
// runOnUiThread { progress_bar.visibility = View.VISIBLE }
}

                override fun onCompleted() {
                    runOnUiThread {
                        exportMp4ToGallery(applicationContext, videoPath!!)
                    }

                }

                override fun onCanceled() {
                    Log.d("VideoEditingActivity", "onFailed()")
                }

                override fun onFailed(exception: java.lang.Exception) {
                    Log.d("VideoEditingActivity", "onFailed()")
                }
            }).start()

This should fix.

#17 (comment)

In summary use a different filter to save the video than one created to show the video.