Wednesday, April 15, 2009

Making animations in Linux with ffmpeg and meconde

This information is taken from http://electron.mit.edu/~gsteele/

To make an animation from the image files, you may use mencode or ffmepg. Here, we will use mencode. First, all the images need to be converted to .jpg format :

In linux shell, type the following code :

for f in *png ; do convert -quality 100 $f `basename $f png`jpg; done

Then use encoder to create an avi file.

mencoder "mf://*.jpg" -mf fps=5 -o ModisTerra_Gocek.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800

I wanted my animation to display slower but setting the frame rate less than 5fps confused vlc, my favorite open source movie player (http://videolan.org) :

[00000420] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)

So I created the animation at 5 fps but reduced the playing speed from vlc.

It is also possible to view the animation with mplayer. Mplayer can even display a movie with a frame rate of 1 fps, no problems. One can adjust the move playing speed by pressing the [ and ] keys.

No comments:

Post a Comment