We are going to animate a rotating cardioid. Running the following code in mathematica should create 50 frames of the rotation.
The result should be a sequence of images "frame??.jpg" with k running from 00 up to 49 in our directory.
To install mencoder on a Mac, you need to be able to open zip files. The most popular program to do this is StuffitExpander.
Mencoder is free software, and is distributed with the free program ffmpegX. The most current version is available at http://prdownloads.sourceforge.net/mplayerosx/ffmpegXbinaries20060307.zip. In the future, you may want to check http://prdownloads.sourceforge.net/mplayerosx/ and download the latest version.
Download the file "ffmpegXbinaries20060307.zip" to your desktop. Then double click on it. StufitExpander should unzip it into a folder on your desktop called "ffmpegXbinaries20060307 Folder".
Now, open a terminal and do the following. You will have to enter your password to do the sudo command.
You should now be able to execute "mencoder" on the command line (in a terminal). You can now remove the file "ffmpegXbinaries20060307.zip" and the directory "ffmpegXbinaries20060307 Folder".
We will encode the jpeg frames into a movie using mencoder. See the mencoder manual. The following must be run in a terminal.
You will need to adjust the "w=400:h=400" portion to account for your images' width and height that you generated with mathematica. You should test the generated movie, "output.avi", on a Mac by attempting to view the movie in Quicktime.
We will be following Jens Nöckel's instructions for emebeding a movie in a latex presentation.
Download "movie15.sty" from CTAN's movie15 directory. If you need additional help, you may wish to consult the readme that can be found on the same page.
Also "ifdraft.sty" is needed by "movie15.sty". Download "ifdraft.dtx" from CTAN. Then execute the following.
This will generate our needed file "ifdraft.sty".
Move the movie, "ifdraft.sty", and "movie15.sty" to the same directory, where we will create our latex presentation.
We give the following demonstration for embedding our movie an a beamer presentation. I call this file "movie.tex".
Now run pdflatex.
This should generate the file "movie.pdf", which contains our embedded movie. In order to open the pdf file to see the movie, you will need to use a recent version of Adobe Reader on either OsX or Windows.
More information on how to use "movie15.sty" can be found in the author's package description.