Add overlay while record video on Android

独自空忆成欢 提交于 2019-12-04 09:42:00

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

About video recording: android-gpuimage library does not support it 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

This project (MagicCamera) has many multiple input filters. You can write your own fragment shader to overlay an image on camera texture (similar to MagicN1977Filter). It also includes video recording.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!