Skip to content Skip to sidebar Skip to footer

How Can I Draw On A Video While Recording It In Android, And Save The Video And The Drawing?

I am trying to develop an app that allows me to draw on a video while recording it, and to then save both the recording and the video in one mp4 file for later use. Also, I want to

Solution 1:

Here's a rough outline that should work, but it's quite a bit of work:

  1. Set up a android.media.MediaRecorder for recording the video and audio
  2. Get a Surface from MediaRecorder and set up an EGLImage from it (https://developer.android.com/reference/android/opengl/EGL14.html#eglCreateWindowSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, java.lang.Object, int[], int) ); you'll need a whole OpenGL context and setup for this. Then you'll need to set that EGLImage as your render target.
  3. Create a SurfaceTexture within that GL context.
  4. Configure camera to send data to that SurfaceTexture
  5. Start the MediaRecorder
  6. On each frame received from camera, convert the drawing done by the user to a GL texture, and composite the camera texture and the user drawing.
  7. Finally, call glSwapBuffers to send the composited frame to the video recorder

Post a Comment for "How Can I Draw On A Video While Recording It In Android, And Save The Video And The Drawing?"