Here you can find the source of getVideoThumbnail(String videoPath, int width, int height, int kind)
public static Bitmap getVideoThumbnail(String videoPath, int width, int height, int kind)
//package com.java2s; import android.graphics.Bitmap; import android.media.ThumbnailUtils; public class Main { public static Bitmap getVideoThumbnail(String videoPath, int width, int height, int kind) { try {/*from ww w . j a va 2s. c o m*/ Bitmap bitmap = null; bitmap = ThumbnailUtils.createVideoThumbnail(videoPath, kind); System.out.println("w" + bitmap.getWidth()); System.out.println("h" + bitmap.getHeight()); bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height, ThumbnailUtils.OPTIONS_RECYCLE_INPUT); return bitmap; } catch (Exception e) { e.printStackTrace(); } return null; } }