how to convert series of jpegs to flv using imagemagik and php?

旧时模样 提交于 2019-12-31 07:12:15

问题


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


回答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



来源:https://stackoverflow.com/questions/8404427/how-to-convert-series-of-jpegs-to-flv-using-imagemagik-and-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!