How to View/Create animations with Molden

How to View/Create animations with Molden

NOTE: all software mentioned here is free public domain software.

This page consists of two sections. The first section is devoted to creating .avi animations from within molden/gmolden. This is a relatively new funcionality which is available in molden versions 5.2.1 and up. The second section is devoted to the older recipe of creating animations with the help of external programs. This can still be useful, especially the light weight gif animations.


Creating .avi animations from within molden/gmolden

From within the molden interface you can now create .avi movies This functionality depend on a third party package avconv. (To install on linux: sudo apt-get install libav-tools). Molden first checks if avconv exists on your system, by internally executing:

which avconv

If avconf exists, after clicking the movie icon the following window will appear:

Screen snap shots are made in the .bmp image format. These screen snap shots will be converted into a molden.avi animation (default name), by internally executing the following command:

avconv -r %d -i %s%%03d.bmp -target pal-dvd -s %dx%d molden.avi

The resolution of the main molden/gmolden drawing screen can be increased from within the "Create Movie Window" and is passed onto the -s flag of the avconv command.
Clicking the "Real Time" check box will determine the frame rate of the animation to be set, such that you will see the animation at the same rate as in molden/gmolden (-r avconv command flag).
Clicking the "Record" button will start the generation of screen shots. Now you can rotate your molecule, animate the geometry optimisation, or watch a normal mode etc.
Clicking the "Stop & Create Movie" button will execute the avconv command to create the animation.


Creating animations with external tools


Viewing animations

Why should you want animations when you already have molden ? For one thing you can create animations to be used in a WEB tutorial. Secondly, for large molecules such as proteins the solid drawing mode is prohibitively slow. These Molden pages use two kinds of animations; gifanim and fli. The gifanim animations are handled by the Internet Explorer and Firefox browsers. On an Xwindows platform fli can be viewed with xanim. xanim is a program for viewing a wide variety of animation formats under X11. To have animations automatically displayed from a WWW browser read about MIME types.

You should now be able to watch the following animation:


Creating animations with Molden

With the latest version of Molden it is also possible to create animations. I have never succeeded in making a decent mpeg animation of a series of gif files, therefore I restrict myself to two types of animations: , .fli and gifanim, for both you'll need some additional software.


gifanim animations

A gifanim actually uses the GIF89a format, which allows multiple gifs to be stored in one file along with the information of how many times the animation should be looped (See the GIF Animation software page).

Hoe to create a gifanim with molden:

Have a look at this gifanim.

NOTE: Use the molden commandline flag -l if you dont want the molden logo in your animation.


.fli animations

Additional software needed:

Here is in short a session for creating a fli animation:

Using fli animations in your own WWW HTML pages

Your WWW server has to know about fli animations. Add the following line to the file mime.types in the servers conf directory:

video/fli                      fli


VRML2.0 animations

Molden can create two types of VRML 2.0 animations: