0

I have series of jpegs , i want to make flv or mpg from all the images . How can i do it with using imagemagik and php .

exec(convert image1.jpg image2.jpg one.flv) make blank flv

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
mohit nagpal
  • 103
  • 11

1 Answers1

1

Well I would jump stright into using ffmpeg. You can also do it using ImageMagick; however the docs state you need ffmpeg installed, so why have the middleman?

I haven't tested this, fair warning.

/*   cmd                 img series    codec       bitrate framerate  optional -s WidthxHeight and output filename */
exec(ffmpeg -f image2 -i image%d.jpg -vcodec mpeg4 -b 800k -r 12 video.avi);
/* For Mpeg4 *

/*For FLV */
exec(ffmpeg -f image2 -i image%d.jpg -vcodec flv -b 800k -r 12 video.flv);

If you want to use the outdated mpeg2 or mpeg1 formats you can do that as well. I would suggest connecting via ssh and testing these commands, and hopefully you have ffmpeg installed. a ffmpeg -formats will show you which formats are supported:

See the docs: http://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion

and this great answer which I stole various things from:

Image sequence to video quality

Community
  • 1
  • 1
Ben
  • 745
  • 7
  • 23
  • I don't have ffmpeg installed on server ,(and i Can't install it) and ImageMagik is installed there. So i want to do it with ImageMagik . How can i do it using ImageMagik ? – mohit nagpal Dec 06 '11 at 19:16
  • As far as I know, you can only make a gif with imagemagick http://www.imagemagick.org/script/formats.php – Ben Dec 06 '11 at 19:36
  • You could ask your host if they will install it (I doubt they will, because of load on the server) Or here is a hack guide to installing it on a shared host via SSH - not sure if it works or not. http://agafix.org/how-to-install-ffmpeg-on-a-shared-server-dreamhost/ – Ben Dec 06 '11 at 19:50