MediaCodec render on offscreen GL Texture notworki

2019-08-29 04:33发布

问题:

I am doing some video frame extracting work, based on the sample given by BigFlakes's example code

It worked well for most of the videos I tested with, however, there are some video clips which I shot by my phone, cannot be correctly extracted by this method. Please refer to the screen shot. The correct frame is extracted by default MediaMetadataRetriever, and the "image of the colors" is extracted by the sample code.

Correct Frame:

False Frame:

The testing video clip is here It can be played by extractor + mediacodec + surface without any problem Nest.mp4

It seems that the problem is from the GL Texture Rendering. Could anyone help to point out what could possibly go wrong? Why it works for most of other videos while it always fail on some of the video clips?