如何使用imagemagik和php将一系列jpeg转换为flv? [英] how to convert series of jpegs to flv using imagemagik and php?

查看:143
本文介绍了如何使用imagemagik和php将一系列jpeg转换为flv?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一系列jpeg,我想从所有图像中制作flv或mpg。我怎么能用imagemagik和php做到这一点。

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

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

推荐答案

好吧,我会直接使用ffmpeg。你也可以用ImageMagick来做;然而,文档声明你需要安装ffmpeg,为什么要让中间人?

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);

如果你想使用过时的mpeg2或mpeg1格式,你也可以这样做。
我建议通过ssh连接并测试这些命令,希望你安装了ffmpeg。
a ffmpeg -formats 将显示支持的格式:

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:

查看文档:
http://ffmpeg.org/ffmpeg.html#Video - 和音频文件格式转换

这个很棒的答案,我偷了各种各样的东西:

and this great answer which I stole various things from:

图像序列到视频质量

这篇关于如何使用imagemagik和php将一系列jpeg转换为flv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆