3

Getting bitmap from video using metadata retriever takes too much of time in Android 10 but below Android 10 works well. Facing this issue only in Android 10. getFrameAtTime and getScaledFrameAtTime both are slow in Android 10.

Here I have added the code that I used to get bitmap form video

  Bitmap bitmap = null;
    MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
    mediaMetadataRetriever.setDataSource(context, videoUri);
    bitmap = mediaMetadataRetriever.getScaledFrameAtTime( ONE_SECOND_IN_MILLI, MediaMetadataRetriever.OPTION_CLOSEST_SYNC,THUMB_WIDTH,THUMB_HEIGHT);

build gradle sdk version

   compileSdkVersion = 28
   def nativeBuildSystem = 'none'
     defaultConfig {
        applicationId "com.example.example"
        minSdkVersion 26
        targetSdkVersion 28
    ...
    }
MathankumarK
  • 2,717
  • 1
  • 17
  • 34

1 Answers1

0

bug of Android P , like huawei P30, newest has fixed. Uri convert to file is a valid method

Embiid
  • 1
  • 2
    It would be helpful if you could provide a source for this, so OP can get more information on the issue. – JonC May 14 '20 at 06:30