/**
* 视频取首帧,并保存到SDCard
* @param videoPath
* @param saveThumPath
*
*/
public static Bitmap saveVideoThumbnail(String videoPath, String saveThumPath) {
Bitmap bitmap = null;
MediaMetadataRetriever retriever= new MediaMetadataRetriever();
try {
retriever.setDataSource(videoPath);
bitmap = retriever.getFrameAtTime(100);
ImageUtil.cropAndRotate(bitmap, 0, saveThumPath);
} catch (Exception ex){
} finally {
try {
retriever.release();
} catch (RuntimeException ex){}
}
return bitmap;
}