FFMpeg add text to actual video file after recordi

2019-05-18 04:15发布

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));
}

0条回答
登录 后发表回答