Create an thumbnail image from a video file using php with ffmpeg library

For generating an image (thumbnail) from a video file using php with ffmpeg library, use the following code to achieve this.


Use php exec() function to do this. In the above code $target_path is the path where your video file located. $imgPath is the path where you want to store the image to be created. Size of the image to be generated, you can change by changing the value 200×200.

If you don’t know, how to install ffmpeg library in a LAMP environment see the post

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">