pedroSG94 / vlc-example-streamplayer

Example code how to play a stream with VLC
GNU General Public License v3.0
227 stars 93 forks source link

Getting Current Frame #26

Open peterbence3 opened 5 years ago

peterbence3 commented 5 years ago

Is there a way to grab the current rendered frame by VLC (on a TextureView or SurfaceView)?

I was directed to inject an OpenGL ES code snippet to where the VLC is rendering in order to get the current frame into a ByteBufferusing for example, GLES20.glReadPixels(...), then parsing that buffer into a Bitmap. However, it seams that VLC is making the rendering process in a native way where i searched the vlc-android sdk for OpenGL usages in java and i found nothing.

Thanks.

pedroSG94 commented 5 years ago

You can create a SurfaceTexture with OpenGl, send it to VLC and capture a frame with glReadPixels. Anyway if you are using textureview you have getBitmap method but it is really slow.