List of usage examples for android.media MediaMetadataRetriever OPTION_CLOSEST
int OPTION_CLOSEST
To view the source code for android.media MediaMetadataRetriever OPTION_CLOSEST.
Click Source Link
From source file:Main.java
public static Bitmap getVideoFrame(String videoPath, long frameTime) { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); try {// w w w . ja v a 2s . c o m retriever.setDataSource(videoPath); return retriever.getFrameAtTime(frameTime, MediaMetadataRetriever.OPTION_CLOSEST); } catch (IllegalArgumentException ex) { Log.w("FFMPEG.MediaUtils", "illegal argument exception"); } catch (RuntimeException ex) { Log.w("FFMPEG.MediaUtils", "error getting video frame"); } finally { try { retriever.release(); } catch (RuntimeException ex) { } } return null; }