Create Thumbnail From Video in Android Application

Thumbnails can easily be created in Android Application using ThumbnailUtils. If you want to create thumbnail from video, you need to specify file path for your video and thumbnail size MICRO or MINI type.

Using ThumbnailUtils, you can create thumbnail of two types.

1. MediaStore.Images.Thumbnails.MICRO_KIND type will generate thumbnail of size 96 x 96.

2. MediaStore.Images.Thumbnails.MINI_KIND type will generate thumbnail of size 512 x 384.

Creating thumbnail from video file path

Creating thumbnail from particular timeframe of Video

For creating thumbnail at particulat time,MediaMetadataRetriever class cane be used. It provides a unified interface for retrieving frame and meta data from an input media file.

From existing Image file

You can also create thumbnail from existing image also. Just pass the path of image file along with width and height of the desired thumbnail.

From a Bitmap file

Similarly you can also create thumbnail from bitmap also with passing bitmap as source.

That all for now. Please comment for more clarification.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *