Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFmpeg merge images to a video [closed]

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?

like image 526
utdev Avatar asked Dec 06 '25 08:12

utdev


1 Answers

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.

like image 186
Gyan Avatar answered Dec 08 '25 05:12

Gyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!