Skip to content

Latest commit

 

History

History
83 lines (43 loc) · 1.78 KB

README.md

File metadata and controls

83 lines (43 loc) · 1.78 KB

GLMediaHub \ ZTextureRecorder

Introduction

This is a library that supports record video from surface by MediaRecord or MediaCodec.

openGLES part is based on grafika

Libs and Apis

mediarecorderlib

This is a texture recorder library, which input is openGLES texture and output is mp4 files.

It supports for TEXTURE_2D and TEXTURE_EXT frames.

The encoder can be chosen between MediaRecorder(which requires Android L or Above) and MediaCodec.

This lib can be used to record screen, rtmp surface, offscreen textures, and any texture that obtained from a OpenGL thread.
Remind that it do not create OpenGLES thread, it is necessary to pass a OpenGLES Context into it Or init it in a GL thread, such that I can get GLContext from current thread. Thus it is necessary to create OpenGLES context in your own project. A GLSurfaceView is recommended.
It can easily used by four steps:
  1. init capturing params:
    capturingManager.initCapturing(textureWidth, textureHeight,
                        toSaveFilePath,
                        Texture2dProgram.ProgramType.TEXTURE_EXT,
                        encoderType, eglContext);
  1. start capturing manager:
   capturingManager.startCapturing()
  1. pass texture of each frame into it
   capturingManager.captureFrame(textureId)
  1. stop at proper time
    capturingManger.stop();
  1. release on component destroyed
    capturingManger.release();

For more information, just run the demo or contact me by : [email protected]

mediadecoderlib

A empty lib currently.

glrender

A empty lib currently.

Recorder Struct

StructImg2