I am capturing frames from camera and rendering them in real time via OpenGL ES 2.0. Now I want to record them to a movie file along with audio. On iPhone, I had AVAssetWriter that would take care of the recording, giving me 30fps. What are my options on android? I tried search but couldn’t find any.
UPDATE: For those wondering what I am trying to do, see this app: https://play.google.com/store/apps/details?id=com.androidillusion.videocamillusion&hl=en
This is the only app i found that could perform 30FPS video rendering/recording. My goal is to try to figure out how it is done.
Once you capture frames from camera and render them with OpenGL i assume that you already have those frames in your memory and you don’t need to use OpenGL to read-back the rendered images.
You can use FFmpeg or libtheora libraries to interleave your audio/video streams into a file. Both can be compiled for Android and are NDK-friendly.
There are a lot of tutorials for both libraries.
In case of Theora, you can convert you frames to YUV-color using GLES 2 shaders.
P.S. If you need to read something back from OpenGL ES – just use
glReadPixels()and proceed with these video encoding libraries.