我收到此错误“getFrameAtTime:videoFrame是一个NULL指针”下面是我的代码。任何修复此错误的建议
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是一个NULL指针)
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);