问题
I am trying to add waterMark to the video by using this library but i couldn't the get the desired result as shown in the library https://github.com/MasayukiSuda/Mp4Composer-android . can anyone point out or help me how to solve it thanks what i tried
mp4Composer = new Mp4Composer(videoItem.getPath(), videoPath)
// .rotation(Rotation.ROTATION_270)
.size(720, 720)
.fillMode(FillMode.PRESERVE_ASPECT_FIT)
.filter(new GlWatermarkFilter(BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_launcher_background), GlWatermarkFilter.Position.LEFT_BOTTOM))
.mute(muteCheckBox.isChecked())
.flipHorizontal(flipHorizontalCheckBox.isChecked())
.flipVertical(flipVerticalCheckBox.isChecked())
.listener(new Mp4Composer.Listener() {
@Override
public void onProgress(double progress) {
Log.d(TAG, "onProgress = " + progress);
runOnUiThread(() -> progressBar.setProgress((int) (progress * 100)));
}
I tried adding this line: filter(new GlWatermarkFilter(BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_launcher_background), GlWatermarkFilter.Position.LEFT_BOTTOM))
来源:https://stackoverflow.com/questions/60851418/adding-images-to-video-with-help-of-this-mediacodec-api