1

我收到此错误“getFrameAtTime: videoFrame is a NULL pointer” 下面是我的代码。修复此错误的任何建议

 ImageView img = (ImageView) findViewById(R.id.picutre);

  try {

       MediaMetadataRetriever retriever = new MediaMetadataRetriever();
       retriever.setDataSource("/storage/sdcard0/download/videos/kamran.ts");
       Bitmap bMap = retriever.getFrameAtTime(0,MediaMetadataRetriever.OPTION_CLOSEST_SYNC);

       img.setImageBitmap(bMap);

    }
    catch(Exception e){
       Log.d("File","Error Creating image",e);
    }

我也尝试过这两种方法,但得到相同的错误消息(getFrameAtTime: videoFrame is a NULL pointer)

Bitmap bMap = ThumbnailUtils.createVideoThumbnail("/storage/sdcard0/download/videos/kamran.ts", MediaStore.Video.Thumbnails.MICRO_KIND);


Bitmap bMap = ThumbnailUtils.createVideoThumbnail("/storage/sdcard0/download/videos/kamran.ts", Thumbnails.FULL_SCREEN_KIND);
4

0 回答 0