FFMpeg add text to actual video file after recording in Android

我怕爱的太早我们不能终老 提交于 2019-12-07 12:53:55

问题


Am recording a video in Android device using JavaCV and playing it using a videoview. Now want to show a text on video while playing, which is entered after recording video. This text must be seen in all video players while playing the video.

I have gone thro the link How to add text on video recording? too which is expected here too

This is the method called after the video is recorded.

private void playRecordedVideo(Uri videoUri, boolean playVideoInLoop)
{
    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);

    videoView.setLayoutParams(layoutParams);

    videoView.setVisibility(View.VISIBLE);
    videoView.setVideoURI(videoUri);
    if(playVideoInLoop)
    {
        MediaController mediaController = new MediaController(MainActivity.this);
        mediaController.setAnchorView(videoView);
        videoView.setMediaController(mediaController);
        videoView.setOnPreparedListener (new OnPreparedListener() {                    
            @Override
            public void onPrepared(MediaPlayer mp) {
                mp.setLooping(true);
            }
        });
    }
    else
    {
        videoView.setMediaController(null);
    }
    videoView.start();
    btnStart.setText(getString(R.string.txt_finish));
}

来源:https://stackoverflow.com/questions/29532269/ffmpeg-add-text-to-actual-video-file-after-recording-in-android

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