Movies in pdf presentations

You can use the multimedia package in the beamer class to play movies and / or sound files (or indeed run any command you wish, if you are using xpdf). The mechanism is documented in the beamer class documentation. If you want to use multimedia in other presentation styles (e.g. using the built-in slides class), include these packages:

   \usepackage{hyperref,multimedia}

Under Linux, currently there are two ways to show movies in a pdf presentation, either with pdflatex or acroread. Unfortunately the required Latex syntax is different for the two viewers:

xpdf

The best solution I have found is to run it as a link. The advantage of this style is that any viewer (or indeed any other application) can be used. The Latex looks like something like this:

\href{run:mplayer -loop 0 -x 600 -quiet mosaic.mpg}{\includegraphics[width=0.3\textwidth]{mosaic}}
where the last argument "mosaic" is the placeholder image (e.g. mosaic.jpg) in the presentation.

You can also do it using the \movie command. The movie field is the complete command line, e.g.:

\movie[externalviewer]{\includegraphics[width=3cm]{poster.png}}{mplayer
      movie.mpg}
The snag is that there is a small bug in the beamer package: the name of the file is displayed on the slide. The workaround is to create a script to run the video:
\movie[externalviewer]{\includegraphics[width=3cm]{poster.png}}{./RUN}
where RUN contains the line:
mplayer movie.mpg

acroread
The movie field is just the name of the file to be displayed:
\movie[externalviewer]{\includegraphics[width=3cm]{poster.png}}{movie.mpg}
The default viewer for acroread on Linux is xanim; I don't know how to change this.

Bill Christmas
Last modified: Wed Jan 17 10:41:25 GMT 2007