Good day, Does anyone successfully get, show or cr...
# compose-desktop
m
Good day, Does anyone successfully get, show or create a video thumbnail from a specific video file that is in the resource or somewhere in the desktop?
m
You can use ffmpeg from that, the cons is that it’s going to add 20-80 mb size to your app.
🙌 1
m
Hi @mohamed rejeb thanks for this. I already applied the ffmpeg library in my project. Next is I look online for the available codes for ffmpeg and found this out. But currently it does not save or create any image or file for thumbnails. Maybe you have idea for this?
Copy code
fun getThumbnail() {
    val builder: FFmpegBuilder = FFmpegBuilder()
        .setInput("Samples/video.mp4")
        .setPassDirectory("Samples")
        .addOutput("thumbnailed.png")
        .setFrames(1)
        .setVideoFilter("select='gte(n\\,10)',scale=200:-1")
        .done()

    builder.build()
}
s
The link of the library please
That’s how you can use it to call ffmpeg command: https://github.com/bytedeco/javacv/issues/1074#issuecomment-475917709
m
Hi @soufianehamama9 did you successfully used the library to generate thumbnails?
thanks for this @mohamed rejeb
s
@Marc Ivan Lim
implementation("com.arthenica:ffmpeg-kit-full:6.0-2")
m
I thought that this one only works with android, does it work for desktop?
m
Hi @soufianehamama9 thanks, currently that library does not work for desktop. It only works in android what I use is.
Copy code
implementation("net.bramp.ffmpeg:ffmpeg:0.8.0")
and currently my code on calling in thumbnail does not work. Where did you use the library btw. This is my code for thumbnail. fun getThumbnail() { val builder: FFmpegBuilder = FFmpegBuilder() .setInput(“Samples/video.mp4") .setPassDirectory(“Samples”) .addOutput(“thumbnailed.png”) .setFrames(1) .setVideoFilter(“select=‘gte(n\\,10)’,scale=200:-1”) .done() builder.build() }
s
@Marc Ivan Lim For desktop just download the ffmpeg.exe and execute commands on it