Glide: Load Video Thumbnail

Created on 17 Nov 2015  路  12Comments  路  Source: bumptech/glide

How can I load Thumbnail from a video url.
for now I use "MediaMetadataRetriever" to get the bitmap but I want to load it with glide.
is this possible ?

question

All 12 comments

I never did that, but did you try just loading it with .load(Uri)? Maybe an additional .asBitmap() but not necessarily. Also see http://stackoverflow.com/a/30769399/253468

Glide fetch thumbnail of local video only.
I'm asking for a solution to get thumbnail of video from network

Hmm, in that case I suggest that you write a custom model and DataFetcher, something like #699.

Thanks, working like a charm

I think in case of a video it's important to note to use RESULT cache only, to prevent saving the whole video to disk cache even though only a single frame is needed from it. And hopefully that single frame will be decoded from a significantly smaller fraction of the file at the beginning.

@hateum Hello, would you mind sharing how you get it to work with remote url. I am having the same issue and can't figure out the custom model/data fetcher thing. Thanks a lot.

Hey Gents,
I have a solution for the video thumbnail from remote url.

You must use glide 4.5.0 gradle dependency for achieving this..

long interval = 5000 * 1000;
RequestOptions options = new RequestOptions().frame(interval);
Glide.with(context).asBitmap()
.load(APIConfig.URL_VIDEOLOC+feedItem.getVideoFile())
.apply(options)
.into(feedListRowHolder.videoView.getCoverView());

Happy Coding :-)

@santhoshrao519 I tried but It didn't work.

@hateum Can you please post the working Custom implementation for loading thumbnail from a server url of video . I am stuck here for days .

I am currently using .

implementation 'com.github.bumptech.glide:glide:4.7.1' annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

@santhoshrao519 I have tried your solution . It did not worked . TWiStErRob's solution is making some sense to me . But i am not able to implement it .

@hateum hey once try my solution

@santhoshrao519 Thanxk You :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ncit picture Ncit  路  3Comments

billy2271 picture billy2271  路  3Comments

sant527 picture sant527  路  3Comments

StefMa picture StefMa  路  3Comments

r4m1n picture r4m1n  路  3Comments