我发现了几个关于如何从图像创建视频的问题和答案。我设置了其中两个并能够正确制作视频。我尝试了以下方法:
ImageMagick convert -delay 100 -quality 75 photo1.jpg photo2.jpg movie.mpg
FFMPEG ffmpeg -r 10 -b 1800 -i photo1.jpg photo2.jpg movie.mpg
最终结果是视频显示图像有时间,没有效果。我希望了解他们如何在这些图像之间添加淡入和淡出过渡。
最佳答案
我怀疑这是否可以通过开箱即用的库来完成,除非一帧一帧地创建。这两个库都没有真正专注于视频效果。
我能看到的一个命令行解决方案是 dvd-slideshow :
dvd-slideshow is a group of Linux commandline programs that creates a slideshow-style dvd from groups of pictures. Slideshow videos can be made from a directory or some online photo albums. You can add fancy effects like fades, titles, and the Ken Burns effect (slowly zooming and panning at the same time) along with audio to make your slideshows even nicer. There is also a script which generates a menu for your dvd (dvd-menu). The dvd-slideshow tools are open-source programs released under the GNU GPL.
它可以输出 DVD(MPEG-something)和 FLV 等等。您可能需要进行两次转换,但您应该能够结合使用它和 ffmpeg 来构建任何类型的视频文件。
关于php - 从带有转换的图像 unix 命令行创建视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3174710/