# Latex+Beamer+PDF+embedded movies

Finally I found a way to embed videos into Latex-generated PDFs in a platform-independent way!

wget http://mirror.ctan.org/macros/latex/contrib/flashmovie.zip
unzip flashmovie.zip
cp flashmovie/flashmovie.sty $YOUR_TEX_DOCUMENT_DIR Additionally, you need a flash-based video player. Free option: cp flashmovie/flashmovie/player_flv_maxi.swf$YOUR_TEX_DOCUMENT_DIR

I preferred the Longtail Video Player which is free for personal use:

unzip mediaplayer.zip
cp mediaplayer-5.7/player.swf \$YOUR_TEX_DOCUMENT_DIR

This is the mencoder command I use for converting my videos:

mencoder -nosound -forceidx -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=2500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -o video.flv video.avi

And finally, a bare example showing how to create an embedded, full-screen movie in a presentation using the beamer package:

\RequirePackage{flashmovie}
\documentclass[utf8x]{beamer}
\usepackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}

\begin{document}
\begin{frame}[plain]
\begin{textblock}{12.8}(0,0)
\flashmovie[auto=1,loop=1,controlbar=0,engine=jw-player,width=12.8cm,height=9.6cm]{taros_talk.flv}
\end{textblock}
\end{frame}
\end{document
}

The options are pretty much self-explanatory. Ah yes, the whole thing needs an Adobe Reader >=9.0.

Update: The latest version of Adobe Reader for Linux (9.4-2) gives a “3D parsing error” upon opening a page with an embedded flash video. Downgrade to 9.4-1 (Ubuntu package name is acroread_9.4-1, you can get it here) and everything’s fine

## 28 thoughts on “Latex+Beamer+PDF+embedded movies”

1. pretty amazing. thank you. this was something i was looking for.. if u have some updated new stuff related to it . can u please post it too or direct me to it.

• Sure, no problem. I used it recently at an international conference, and all went quite smoothly. I can now confirm that it works with Adobe Acrobat Reader 9+ on Linux, Mac and Windows! :)

2. How did you work around the flash crashing adobe acrobat when changing page issue?

I spent hours searching for a solutions there doesn’t seem to be any :-/

• Sorry, I don’t really get your question… Acrobat reader never crashed on me upon changing pages.

• I managed to solve this problem by removing sound from the videos. Only Linux acrobat is crashing with videos with sound.

Videos without sound work just fine.

3. In your commands above, the ‘cp’ commands don’t make sense. Where do the files need to be copied?

best,
David

• Indeed. I fixed it, basically, you have to copy the files into the directory where your tex document lives. Thanks for remarking this!

• Thank you very much for your post and replay. It finally works and it looks exactly as I wanted. Just one thing, in the slide that has the video on, the colors are brighter than other slides, is this normal?

• I can’t say – I always used only full screen video, so I don’t know if the colors of the slide itself are different.

5. Hi,

Thanks for the post. There is no Adobe Reader version 9.4.1 in the link you provided. Do you know where I can find the downgraded version?

• There is, but they are named depending on your version of Ubuntu. For example the package acroread_9.4-1lucid1_i386.deb is for Ubuntu Lucid Lynx 10.04, 32-bit Intel. I didn’t test with the latest Acrobat Readers – do you still get the “3D parsing error” when using the current version of Acrobat Reader (9.4.7)?

6. I installed an older version of Adobe, but when I try to loop the file it just gives me a loading icon and does not automatically replay the file :-(

• To which version did you downgrade?

7. I am trying this method to embed some videos in my beamer presentation. Unfortunately I have the latest updated acroread installed and which gives the “3d parsing error”. ON top of that, it has messed up my dpkg in some way so that If I try to remove or purge it from my system, it reaches a “LSB module not available” error page and freezes. After this I always need to use kill -9 to terminate dpkg and then do a configure -a to reset it every time. I am not able to remove this version of acroread or force install the downgraded package on top of it. Can you help?

• No, I fear that I can’t help, sorry. This seems to be a problem with the base installation of your system. I assume it’s a recent Ubuntu? Try to update it (apt-get upgrade), if this does not work you have to create a bug report at https://bugs.launchpad.net/ubuntu/

8. I have a linux box running fedora 17.
I am able to load the movie running AR 9.4.1, but I have the problem that it crashes when changing the page that has the movie loaded.
I have also tried the -nosound option when creating the movie, and it also crashes.

Could you give the texlive version you have? mplayer version? pdflatex version?

9. For those who read this post and have trouble finding the AR 9.4.1 version, Adobe
has a ftp server with old versions. You will find them here:

10. Hi all!
Does anyone solved the problem with crashing Acroread while changing the page? I’m slowly getting crazy with this stupid bug.

11. Me too! I have spent the whole night trying to get this to work. Now I’m so close! If only it didn’t crash when I changed the page.

Regardless, thanks for the post.

12. Very useful info! I am struggling against the changing page issue. I have tried using both the free flv-player and the jw-player, with the same result: after I change page AR crashes. Again, same result with a directly embedded swf movie with no engine specified. Anybody managed to solve this? thanks!

• Hi Tom, I was just curious if you had ever tuohght of using Centos? Supposedly just like RH EL just with all the hats taken out. I had a 10gR2 release up and running on my laptop in VM and it was working fine as far as I could tell. Shameless Centos plug I liked the character mode installer as well. Much easier to do remote installs without VNC, etc.

13. Are you all using Ubuntu 12.10? I also have this crashing-when-changing-page problem and I’m running 12.10. If anyone find a solution, please tell!

14. thank you thank you very much. this was something i was looking for……

15. For MEncoder SVN-r36573-4.8.2 the new command options are mencoder -nosound -forceidx -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=2500:mbd=2:mv0:trell:v4mv:o=mpv_flags=+cbp_rd:last_pred=3 -o movie_out.flv movie_in.mp4

16. You can also directly use the

\href{run:myvideo.avi}{\fcolorbox{blue}{white}{\includegraphics[width= 7cm]{mypreview.jpg}}}

command, which does not need any external package. The video will be played in your usual video player.

This site uses Akismet to reduce spam. Learn how your comment data is processed.