Creating movies from multiple jpg picture files

In my research, I produced a number of figures of time sequences. And I wanted to create a movie from this multiple jpg files. I use mencoder to do this, to install type:

sudo apt-get install mencoder (if you are using debian based such as ubuntu)

Then to create the avi file, simply type:

mencoder mf://@list.txt -mf fps=5:type=jpg -ovc lavc vcodec=mpeg4 -o test.avi

where list.txt contains the list of jpg file name that I want to convert. Of course we can simply use mf://*.jpg, however since my jpg file name is like 50.jpg, 100.jpg, 150.jpg, the files are not put in the right order, it will start with files beginning with “1…” first. So I save the correct order by typing:

ls -rt -1 *.jpg > list.txt

this will save the jpg files sorted in time sequence in one column into the file list.txt.