I need to display a video thumbnail based to a URL into an ImageView
view child of my ListView
items, i have found this post but n
@CommonsWare,
This is not the case that for every video store individual thumbnail in server. but we have some library
fmmr.jar with using jniLibs
which directly provide the thumbnail from server url with in 10 second.
The sample code for Thumbnail.
FFmpegMediaMetadataRetriever fmmr = new FFmpegMediaMetadataRetriever();
try {
fmmr.setDataSource(videoPath);
Bitmap b = fmmr.getFrameAtTime();
if (b != null) {
Bitmap b2 = fmmr.getFrameAtTime(4000000, FFmpegMediaMetadataRetriever.OPTION_CLOSEST_SYNC);
if (b2 != null) {
b = b2;
}
}
if (b != null) {
Log.i("Thumbnail", "Extracted frame");
return b;
} else {
Log.e("Thumbnail", "Failed to extract frame");
}
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
} finally {
fmmr.release();
}