Generating Thumbnail From Uploaded Video in Laravel

github logo ・1 min read

Good day guys, Please can any one help me with a working and reliable code for generating a thumbnail from video.I am using laravel spatie library and was able to generate thumbnail from image in a fly but having difficulty to get thumbnail from video. I am developing api for a business android app. Using laravel as back-end api development. My interest is getting thumbnail from uploaded video.

Thanks in advance

twitter logo DISCUSS (1)
markdown guide

I'm not sure about particular package you're talking about, but usually ffmpeg library and any PHP wrapper above it is used (at least php-ffmpeg), general command for CLI looks like this (you can take random time for your videos)
ffmpeg -i $uploaded_file -ss 00:00:01.000 -vframes 1 output.png

Classic DEV Post from Sep 27

What was your win this week?

Got to all your meetings on time? Started a new project? Fixed a tricky bug?

christianRibig5 profile image
Christian has BS computer science(summa cum laude), full stack android and web developer. Always advancing with technology shift.

The fastest growing software community.
Free forever.