Is there any way to create a video file directly from GLSurfaceView(OpenGL ES )?
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?
1 Answer
1
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.
GLSurfaceView.onDrawFrame()
gl.glReadPixels()
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.