FFmpeg merge images to a video

前端 未结 1 1502
野性不改
野性不改 2021-01-07 09:44

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

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-07 10:26

    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.

    0 讨论(0)
提交回复
热议问题