How to make a movie from a sequence of images PDF Print E-mail
Written by Fernando Amat   
Saturday, 22 October 2011 13:37

Imagine you have generated a sequence of images (BMP, PNG, TIFF, etc) and you want to put them together to make a movie. Moreover, you want the movie to be high quality but at the same time you do not want to just save the movie as an uncompressed AVI file. This task is pretty common for me after capturing multiple frames from a Matlab figure or after V3D generates a sequence of BMP images to render a rotation of a 3D scene. So the input is a sequence of images in the same folder names as filename%d.fileExtension


In Mac OS and Linux systems

  • Install FFmpeg in your machine. FFmpeg is a great cross-platform solution to record, convert and stream audio and video and it is free software licensed under the LGPL or GPL. It definitely does much more than this  how to describes, so I recommend you to explore all the options FFmpeg offers. Most Linux distributions as well as MacPorts have FFmpeg available in their repositories, so you do not have to compile everything from scratch.
  • Make sure you include ffmpeg in your PATH so you can call it from any folder
  • Open a terminal an go to the folder containing the sequence of images. Once there type:
ffmpeg -qscale 2 -r 10 -b 10M  -i 'filnename%03d.BMP'  movie.mp4
Basically you are telling FFmpeg to make a file movie.mp4 using the image sequence filenameXXX.BMP. %03d indicates that images are numbered with three digits. IMPORTANT: FFmpeg is picky and wants you to start with XXX=001, otherwise it will complaint that it cannot find the files. The options I use are -r (frames per second), -b (maximum bit rate allowed. Increased to improve the quality of the movie), and -qscale (a way of representing variable bit rate qualities. The closer to 1 the higher the quality). You can find many more details on these and other options here.

In Windows systems

FFmpeg is cross-platform and offers binaries for Windows. So you might be able to just the instructions described above. However, I have never tried it myself, so I can not give any opinion. Here is another way of generating high-quality movies with other free software tools:
  • Under construction
Last Updated on Saturday, 22 October 2011 14:06