I've been looking for something about adding images to videos, but i haven't found what I wanted.
I'd like to add a bitmap/image mask in each frame of a video (it can be recorded or from SD), keeping the original sound, and save the video to the SD with the image.
Someone knows how it can be done in Android?
Thnx
create a class that extends SurfaceView
public class PaintSurface extends SurfaceView {
....
In draw() function add code
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
canvas.drawBitmap(bitmap.img, bitmapPosX, bitmapPosY, null);
}
}
In onCreate function create an object of it.
videoView = new PaintSurface(this);
add it to your layout
RelativeLayout layut = (RelativeLayout) findViewById(R.id.lay);
layut.addView(videoView);
get a holder
videoHolder = videoView.getHolder();
set this holder's surface to the MediaRecorder object
recorder.setPreviewDisplay(videoHolder.getSurface());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With