I want to overlay a shape animation on Camera2/CameraX preview using a custom surfaceview and capture and save the video including both camera output and overlay animation.
I was able to just save a camera output using https://androidwave.com/video-recording-with-camera2-api-android/sample.
But how can I add/include an overlay to the video?
I checked the MediaRecorder, but it can record only camera output. Is it possible to give a canvas/SurfaceView as a media stream? I don't like to use MediaProjection, it's capture is not limited to my app but the whole phone screen.