How to set text on a particular frame on a video in android java?

Viewed 122

I'm making a video editing app where I am trying to add text on a video to a particular frame. I tried to solve this by taking the exact frame and making a bitmap and adding text on it through canvas, but it didn't work.

Here is my code:

    private void extractVideoFrame ( String path , Context context , int time ) {

    MediaMetadataRetriever retriever = new MediaMetadataRetriever ( );
    try {
        retriever.setDataSource ( path );
    } catch ( Exception e ) {
        System.out.println ( "Exception= " + e );
    }
    String duration = retriever.extractMetadata ( MediaMetadataRetriever.METADATA_KEY_DURATION );

    videoFramesBitmapList = retriever.getFrameAtTime ( time );
    pickFrame.setImageBitmap ( videoFramesBitmapList );

    Toast.makeText ( context , "current" + time , Toast.LENGTH_SHORT ).show ( ); FFmpegMediaMetadataRetriever.OPTION_CLOSEST);
}

All I want to do is to add text on a frame from a video, I also don't wanna use ffmpeg, since I have do to through java.

0 Answers
Related