tech star
tech star

Reputation: 25

Is there any way to create a video file directly from GLSurfaceView(OpenGL ES )?

I have created a 3D object on GLSurfaceView(OpenGL ES) on android. Is there any way to create a video file (record 5 seconds) directly from GLSurfaceView(OpenGL ES) without screen recording?

Upvotes: 1

Views: 86

Answers (1)

codeandkey
codeandkey

Reputation: 69

You can capture bitmaps after drawing frames and then combine them into a video format.

In GLSurfaceView.onDrawFrame() you can use gl.glReadPixels() to collect a bitmap image of the frame. You can then pass these to Android's MediaMuxer class afterwards to encode them into a final video.

Upvotes: 2

Related Questions