0

I'm using OpenGLES3.0 to do video processing. I found that it's possible to get frames from a video by using Android MediaExtractor and MediaCodec API together with Surface texture, like below.

glGenTextures( 1, &textureId );
glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);

But there is no such API in GLES3.0.

My question is: is there a relevant API in OpenGLES3.0 to generate and use surface texture? Or is there some other APIs in Android to get all frames from a video?

I tried getFrameAtTime() in MediaMetadataRetriever and FFmpegMediaMetadataRetriever but I could only get the key frames rather than all frames, even with MediaMetadataRetriever.OPTION_CLOSEST.

Vintex
  • 1
  • 4

1 Answers1

0

It seems that 1.1 or 2.0 extensions are still available in 3.0. So to use GL_TEXTURE_EXTERNAL_OES, you only need to include the gl2ext.h.

Vintex
  • 1
  • 4