Recording SurfaceView in Android

246 Views Asked by At

I'm working on a video application where I need to open the front camera and show a the camera preview in the screen. At the same time, I need to apply some effects (like words on the screen) and record all together in order to form a final .mp4 where the video and the effects are both displayed.

I'm trying to understand what would be the correct approach to do this. I don't know if I should capture the whole screen, or to capture the information coming from the SurfaceView and later draw the effects on it.

I've been reading something about RecordableSurfaceView. Would you recommend me to use this library or should I change the approach?

1

There are 1 best solutions below

2
Enes Sıtkı On

I have an app where I stream live video with Surfaceview. After a lot of research, I couldn't find how to save the video on surfaceview. Then I tried the HBRecorder library and was successful.

I set the video encoder to H264. You can change a lot of features like that. I'm put the github link below. I hope that helps.

HBRecorder for screen recording