Record GLSurfaceView
zoopolitic opened this issue · 8 comments
First of all, thank you for such a great work, there is a lot of useful info and examples here as well as answers by you on stackoverflow.
I've checked RecordFBOActivity and I see that you using simple SufraceView with your own RenderThread instead of GLSurfaceView to have more control over EGLSurface.
I'm quite new to openGL and maybe don't fully understand all nuances but as far as I see (in blit mode) you're activating framebuffer, then making draw call to execute all gl draw commands and then drawing it again twice, once for display and once for videoencoder.
Can it somehow be accomplished with GLSurfaceView ? I mean recording, since I want to use render thread of GLSurfaceView instead of adding my own RenderThread. I'm currently drawing camera texture and adding some other textures using glDraw calls so I want to record all this stuff. I know that glSurfaceView is manage all EGL context and surface by itself, but we can provide factory for it, although we still won't be able to access underlying EGLSurface.
Also what is the most performant way to record, I see that you use 3 modes, mode with gl 3.0 doesn't fit since it covers too few devices so what is the best way: draw twice method or FBO ?
Thanks.
It can be done with GLSurfaceView, but because of the way the class manages the EGLSurface it's a lot harder.
At one point I made a game recording patch for Android Breakout, but that had a serious flaw in its implementation (see this link).
I expect that copying rendered output will be faster than re-rendering the entire scene for most applications. One advantage of "draw twice" is that you don't have to wait for the first render to complete, but that's not important for most apps.
What flaws does GameRecorder has ? Using SurfaceView with RenderThread does not have these flaws ?
Got you, thanks
Hi, I to want to achieve the same thing you want(ed): record camera preview and some textures added on top of it. Did you manage to do this? If so, can you show me your example?
@zoopolitic hi ! can you tell me how to record glsurfaceview ? it seems CameraCaptureActivity record surfacetexture instead glsurfaceview ? is it right? sorry for my poor english.
@shiguiyou I ended using SurfaceView instead of GLSurfaceView
@zoopolitic ...ok,thanks for reply.