Search code examples
phpimagemagickimagick

PHP script to convert multiple images into a video with imagick


I found this command line that uses ImageMagick to convert images into a video:

ImageMagick convert -delay 100 -quality 75 1.jpg 2.jpg movie.mpg

Is there a way to do this in php with imagick? I am trying to find a way to do this on a website.

My google-fu has failed me and I appreciate any help :)


Solution

  • Considering that convert is the executable program you're using from the command-line, the simplest solution would be to use it from your PHP scripts ;-)


    About that, you'll want to read through the System program execution section of the manual.

    You'll probably be especially interested by exec() and/or shell_exec() -- and do not forget to escape your arguments, with escapeshellarg().