Monday 10 October 2011

Merging images into movie using FFmpeg

Let's say that you have a number of images, named image001.jpeg, image002.jpeg, image003.jpeg etc., and you want to merge them into a single movie, for example to create a time-lapse video. FFmpeg is a great commend-line tool for doing this kind of stuff. To use FFmpeg to create the movie "outmovie.mp4", with 25 frames per second and reasonable quality, enter

ffmpeg -i image%03d.jpeg -sameq -r 25 outmovie.mp4

Note the format image%03d.jpeg, indicating that the numbering of the files has three digits with (possible) leading zeros. To set the output bitrate explicitly to for example 64 kbits/s, use the switch "-b 64k" rather than "-sameq". See the FFmpeg documentation for lots of other possibilities.

4 comments:

Unknown said...

Thanks! Just used this to make a movie out of png files exported from Synfig Studio and it worked great.

Martin H. Skjelvareid said...

Glad to be of help!

ciukes said...

You may want to scale images first. ImageMagic is the best.
> mogrify -resize 1024x768 -verbose *.JPG

More: http://www.imagemagick.org/www/mogrify.html

Erick Aldi said...

Thanks for this awesome example !!!
Greetings from Guatemala.

Post a Comment