Cannot @blend with provided texture id
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
-
What am I might missing?
-
Maybe you can tell me in general how to blend two videos using the @blend filter in a right way, please.
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.
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.
I made a new attempt to achieve the desired effect, but still no luck. @wysaid please, help me out. All work was at classes:
- https://github.com/netherpyro/android-gpuimage-plus/blob/textureid/library/src/main/java/org/wysaid/view/ExtractMpegFrames.java
- https://github.com/netherpyro/android-gpuimage-plus/blob/textureid/library/src/main/java/org/wysaid/view/VideoPlayerGLSurfaceView.java
- https://github.com/netherpyro/android-gpuimage-plus/blob/textureid/library/src/main/java/org/wysaid/common/SharedContext.java
Sorry for the late reply. I'm too busy recently. I'll see it soon.
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!