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

Cannot @blend with provided texture id

Open netherpyro opened this issue 6 years ago • 5 comments

I'm trying blend test video with another video by using "@blend sr [" + mVideoTextureID + "," + mVideoWidth + "," + mVideoHeight + "] 100" config string but getting error repeatedly

W/Adreno-ES20: <core_glBindTexture:573>: GL_INVALID_OPERATION E/libCGE: After "glDrawArrays" glGetError invalid operation(0x502) at /Users/wysaid/work/bitbucket/android-gpuimage-plus/library/src/main/jni/cge/common/cgeImageFilter.cpp:209

  1. What am I might missing?

  2. Maybe you can tell me in general how to blend two videos using the @blend filter in a right way, please.

netherpyro avatar May 16 '19 08:05 netherpyro

You must use the same (or shared) GL context, or the texture id will not be valid. So you must create a SharedContext first, and use it to run your filters.

wysaid avatar May 18 '19 16:05 wysaid

Sorry to bother you again, asking for your help: could you show a test case using a filter where the blending of the two videos takes place please? I was trying to do this using MediaCodec which renders the video to offscreen surface and use its texture to feed blend filter.

netherpyro avatar May 20 '19 11:05 netherpyro

I made a new attempt to achieve the desired effect, but still no luck. @wysaid please, help me out. All work was at classes:

  1. https://github.com/netherpyro/android-gpuimage-plus/blob/textureid/library/src/main/java/org/wysaid/view/ExtractMpegFrames.java
  2. https://github.com/netherpyro/android-gpuimage-plus/blob/textureid/library/src/main/java/org/wysaid/view/VideoPlayerGLSurfaceView.java
  3. https://github.com/netherpyro/android-gpuimage-plus/blob/textureid/library/src/main/java/org/wysaid/common/SharedContext.java

netherpyro avatar May 21 '19 12:05 netherpyro

Sorry for the late reply. I'm too busy recently. I'll see it soon.

wysaid avatar May 23 '19 03:05 wysaid

Finally I've figured out why got error above: filter's blended texture should be in GL_TEXTURE_2D instead of GL_TEXTURE_EXTERNAL_OES target. Thank for your attention to issue! I'd be more happy if two- or more videos blend and render in a test case came to present!

netherpyro avatar May 27 '19 06:05 netherpyro