Adding images to video with help of this MediaCodec Api

岁酱吖の 提交于 2020-05-17 08:33:25

问题


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

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