coobird / thumbnailator

Thumbnailator - a thumbnail generation library for Java
MIT License
5.14k stars 784 forks source link

Does it support video to convert as image file?? #127

Closed kashsbd closed 4 years ago

kashsbd commented 6 years ago

Does it support video to convert to image file??

coobird commented 6 years ago

What are your expectations?

Given what input, what is your expected output?

coobird commented 4 years ago

No reply to follow-up question for close to 2 years. Closing.

andreas-mausch commented 4 years ago

I'd like to make a thumbnail of a single frame of a video (let's say .mp4 H264). Can I do this with thumbnailator?

dphans commented 4 years ago

@andreas-mausch I think NO. And from Android Q, you can use ThumbnailUtils directly, no need additional libraries: For example:

import android.media.ThumbnailUtils

val videoFile = File("path/to/video.mp4")
val videoThumbnail: Bitmap = ThumbnailUtils.createVideoThumbnail(videoFile, Size(100, 100), null)

val audioFile = File("path/to/music.mp3")
val audioThumbnail: Bitmap = ThumbnailUtils.createAudioThumbnail(audioFile, Size(100, 100), null)

val imageFile = File("path/to/photo.jpeg")
val imageThumbnail: Bitmap = ThumbnailUtils.createImageThumbnail(imageFile, Size(100, 100), null)
coobird commented 4 years ago

@andreas-mausch Probably no. Thumbnailator relies on the Java Image I/O to read images, and I'm not aware of an image reader that supports video files.