FFmpeg merge images to a video

a 夏天 提交于 2020-06-08 15:11:22

问题


How can I create a mpg/mp4 file from let's say 10 images using ffmpeg.

Each image shall stay for 5 minutes, after the 5 minutes are over the next image shall appear and so on....

How can I achieve this?


回答1:


If your images are numbered in a sequence (img001, img002, img003..), use

ffmpeg -framerate 1/300 -i img%3d.jpg -r 5 video.mp4

(I've set an output framerate of 5 for player compatibility. Each image will still remain for 300 seconds)

If your filenames are irregular, and you are executing in a Unix shell like bash, you can run

ffmpeg -framerate 1/300 -pattern_type glob -i '*.jpg' -r 5 video.mp4

For MPEG-2,

ffmpeg -framerate 1/300 -i img%3d.jpg -c:v mpeg2video -b:v 2000k -r 5 video.mpg

No idea what minimum output framerates are expected of MPEG-2. Experiment.



来源:https://stackoverflow.com/questions/38895736/ffmpeg-merge-images-to-a-video

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