Android - Add text or image while recording video?

4.2k Views Asked by At

I am struggling with recording and editing videos. For editing, I found a useful library in Android named ffmpeg4Android. However, I am still get stuck in recording video. Here is what I want:

1/ Add text or images in video while recording
2/ Add filter while recording video

I found there is a library GPUImage for Android but it has only some examples related to taking a photo, not to recording video)

Please let me know if you have any ways or any suggested libraries which can do it.

Thank you in advance!

Links which I read when researching:
Add overlay while record video on Android
How to Record video with GPUImage?
FFMpeg add text to actual video file after recording in Android

1

There are 1 best solutions below

0
On

You can add an overlay image on video using a blend filter.

You cannot add text directly but you can add the text to the image writing on a canvas.

android-gpuimage library does not natively support video recording but you can try using the android-gpuimage-videorecording library. It is a fork of the gpu-image for android that provides also the video recording functionality

android-gpuimage-videorecording

see the GPUImageMovieWriter class

It should point you in the right direction for developing your own video writer on top of GPUImage.

The idea is to:

  • draw on current screen surface
  • switch to encoder input surface and draw previous frame buffer again on it
  • switch back to screen surface

other useful links: EGL surface helper, Media encoder