Insert Movies in your PDF document – LaTeX

This post is because I see an increasing number of Google searches on “movie15” leading to my blog 🙂 just because of the mention of the movie15 package in the LaTeX – Beamer tutorial.

So, inserting movies is very easy, nothing to fret! Just ensure that you have a PDF reader that supports multimedia. Adobe Reader 9 and Foxit Reader 3 does. Even the Portable Foxit Reader does the job, and it is pretty useful if you are taking your PDFs as presentations to different places.

So your document head should have the line \usepackage{movie15} followed by the standard \begin{document}.

Insertion of the movie is exactly like the insertion of a figure.
\begin{figure}[ht] \includemovie[poster,text={\small(Loading Video...)}]{6cm}{4cm}{decoded_initial.avi} \end{figure}

The poster options inserts the first frame of the video and then loads the movie clip, Loading Video… is that text which appears before the video loads in your PDF reader, 6cm is the width, 4cm is the height and decoded_initial.avi is the movie filename.

There are many more options to reference a movie, make it play, pause, etc. which can be found at the CTAN (Comprehensive TeX Archive Network). That page also gives a list of the supported video formats.

Give your PDF reader some time, and it should be able to render your video.

2 thoughts on “Insert Movies in your PDF document – LaTeX”

1. mhatthei

Ok in fact I can’t print the chevron character… 3rd try… sorry about that… (\):
Inserting an image along with an item list should look like this:
\includegraphics\[width=\textwidth]{img1.jpg}

I just spent 2 days on this problem…

I am trying to show the movie at the same time as an item in an item list…
How can I show the movie with the first item?

If I had an image instead of a movie I would write it like this:
\includegraphics\[width=\textwidth]{img1.jpg}

But for a movie it is not working… it shows the movie after all the items in the list are shown.
\includemovie\[poster]{3.25cm}{3.25cm}{movie1.jpg}
This doesn’t work neither:
\visible\{\includemovie[poster]{3.25cm}{3.25cm}{movie1.jpg}}

Full working code snipet:
———————————
\begin{frame}
\frametitle{Overlay Specification}
\begin{columns}
\begin{column}{5cm}
\begin{itemize}
\item Figure 1
\item Figure 2
\item Figure 3
\end{itemize}
\vspace{3cm}
\end{column}
\begin{column}{5cm}
\includegraphics\[width=\textwidth]{img1.jpg}
\includegraphics\[width=\textwidth]{img2.jpg}
\includegraphics\[width=\textwidth]{img3.jpg}
\end{column}
\end{columns}
\end{frame}
———————————

But now I replace the first figure with a movie and it is not working anymore?
(See below…)
———————————
\begin{frame}
\frametitle{Overlay Specification}
\begin{columns}
\begin{column}{5cm}
\begin{itemize}
\item Figure 1
\item Figure 2
\item Figure 3
\end{itemize}
\vspace{3cm}
\end{column}
\begin{column}{5cm}
\leavevmode
\visible\{\includemovie[poster]{3.25cm}{3.25cm}{images/predoc_oral/bullet_lg.mpg}}
\includegraphics\[width=\textwidth]{img2.jpg}
\includegraphics\[width=\textwidth]{img3.jpg}
\end{column}
\end{columns}
\end{frame}
———————————

Thanks!

2. mhatthei

Ok, for future references, here’s a working piece of code to show how to get it done… Not the way I wanted, but at least the video is displayed on the slide I wanted. The first slide is the fail, and the second the working one. I am pretty sure there is a more elegant solution to this, so let me know please if you figure something out. (See the discussion here: http://tex.stackexchange.com/questions/39814/movie15-sty-includemovie-beamer-show-the-movie-at-the-same-time-as-an-item-in)

\documentclass[10pt]{beamer}
\usepackage{graphicx}
\usepackage{movie15}
\def\hilite{\temporal{\color{gray}}{\color{blue}}{\color{blue!25}}}
\begin{document}
\begin{frame}
\begin{columns}
\column{.5\textwidth} \hspace{0.001cm}
\begin{itemize}
\hilite \item Line 1
\hilite \item Line 2
\hilite \item Line 3
\end{itemize}

\column{.5\textwidth} \hspace{-20pt}
\begin{figure}[hpt!]
\visible{
\includemovie[poster,autoplay]{3.25cm}{3.25cm}{images/predoc_oral/bullet_lg.mpg}}
\end{figure}

\begin{figure}[hpb!]
\includegraphics[width=\textwidth]{images/predoc/WMAP_pie.png}
\end{figure}
\end{columns}
\end{frame}

\begin{frame}
\begin{columns}
\column{.5\textwidth} \hspace{0.001cm}
\begin{itemize}
\hilite \item Line 1
\end{itemize}

\column{.5\textwidth}
\vspace{-20pt}
\begin{figure}[hpt!]
\visible{\includemovie[poster,autoplay]{3.25cm}{3.25cm}{images/predoc_oral/bullet_lg.mpg}}
\end{figure}
\end{columns}

\begin{columns}
\column{.5\textwidth} \hspace{0.001cm}
\begin{itemize}
\hilite \item Line 2
\hilite \item Line 3
\end{itemize}

\column{.5\textwidth}
\vspace{20pt}
\begin{figure}[hpb!]
\visible{\includegraphics[width=\textwidth]{images/predoc/WMAP_pie.png}}
\end{figure}
\end{columns}
\end{frame}

\end{document}