Creating a Video from Images
ffmpeg can be used to stitch several images together into a video.
There are many options,but the following example should be enough to
get started. It takes all images that have filenames of
XXXXX.morph.jpg,where X is numerical,and creates a video called
“output.mp4”. The qscale option specifies the picture quality (1 is
the highest,and 32 is the lowest),and the “-r” option is used to
specify the number of frames per second.ffmpeg -r 25 -qscale 2 -i %05d.morph.jpg output.mp4
(The website that this blurb was taken from is gone. Link
has been removed.)
其中25表示每秒25张图像.您可以将其设置为1(略)(1秒)延迟或使用小数,IE:0.5延迟2秒.
然后,您可以将视频和音频流与此类似.
ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -b:a 128k final.mp4
当然可以选择适合的编解码器.如果你想要一个mp4使用libx264的视频和aac(内置到ffmpeg,不再是“实验”)的音频.
只要记住,如果您选择使用ffmpeg输出的方法,默认情况下,当您尝试读取它时,stderr.如果你愿意,它可以被重定向到stdout.