Here’s a simple tutorial in order to extract a thumbnail from a video using FFMPEG and PHP.
First of all let’s install FFMPEG ( you probably already got it if you know what kind of kick-ass video manipulator it is ):
Then let’s set up our script: the main problem is the use of the
shell_exec() function, in order to run a shell command inside PHP.
If you don’t know anything about
shell_exec() or shell escaping please don’t use this tecnique and go ahed to php.net to read some documentation about it.
At least, you also need to have
shell_exec() enabled in your server, so shared hosting won’t fit your requirements.
Here’s the way:
1 2 3 4 5 6 7
so you’ll be able to see your thumbnail of the video at the location you specified.