# How read movie with LaTex?

I make a presentation with LaTex using beamer.

I have succeeded in add movie in Sharelatex and my code is as follows :

\documentclass[]{beamer}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{multimedia}

\begin{document}
\begin{frame}{}
\begin{center}
\movie[width=0.5\textwidth,showcontrols=true]
{% placeholder = text or image
\includegraphics[width=0.4\textwidth]{myPic.png}
}%
{myMovie.avi} % video filename
\end{center}
\end{frame}
\end{document}


But I can't read my movie in Ubuntu. I read in some site it's because my PDF reader can't. I may understand it's possible but I doesn't find how.

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – ebosi Apr 5 '16 at 14:18
• Which pdf reader are you using? – user36296 Apr 5 '16 at 14:23
• My pdf reader is Evince. – Bugsyaya Apr 5 '16 at 14:32
• If you can french: Intégrer des vidéos dans des fichiers PDF – ebosi Apr 5 '16 at 14:36
• My bad: I edited your original post deleting the fact that your OS is Ubuntu. I apologize. – ebosi Apr 5 '16 at 14:42

As you mentioned you are using Ubuntu, the question PDF viewer combined with video player on Askubuntu suggest to use Okular to read the video embedded in your PDF.

Indeed, all pdf-reader do not support movies-, screen- or rich media-annotations; evince is one of them.

Following MWE worked for me with .avi and .mp4 videos, when open with Okular: 0.19.3.

\documentclass[bookmarks=true]{beamer}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{multimedia}

\begin{document}
\begin{frame}
\begin{center}
\movie[%
height = 6cm,%
width = 6cm,%
showcontrols,%
poster%
]%
{\includegraphics[width=0.5\textwidth]{example-image}}
{SampleVideo}
\end{center}
\end{frame}
\end{document}


Note that:

• You must explicitly give your video file extension in your tex code (e.g. SampleVideo.avi, or SampleVideo.mp4);
• The video file must be located in the same folder than your pdf.
• You must have H.264 codecs installed on the computer.
• I install Okular. The movie look like to play but nothing is read. May be an other problem with my code or my movie. Thanks for your help – Bugsyaya Apr 5 '16 at 14:51
• It was the case for me indeed. But suggested MWE in the edit of my answer works fine for me. (Okular: 0.19.3) – ebosi Apr 5 '16 at 15:28
• I have Okular: 0.19.3 too. I read if we don't add \usepackage{media9}, the movie is not really add to the PDF. And when I add poster, I can't play the movie.. I don't understant how your movie can play. But I test your code with an other movie, I add the package media9 and it's works. The only difference between my two movies are the extention. – Bugsyaya Apr 5 '16 at 15:58
• I recompile and test it again... it works. But I found that SampleVideo2.avi should be in the same folder than your PDF. Moreover, you must explicitly give the movie file extension in your .tex document (e.g. SampleVideo2.avi and not SampleVideo2). It also worked for me with .mp4 file. – ebosi Apr 6 '16 at 6:53
• It's works ! :D The problem was I havn't H.264 codecs installed on my computer... Thanks a lot for your help ebo :) – Bugsyaya Apr 6 '16 at 13:43

\href{movie.avi}{\includegraphics{movie.jpg}}

It's not embedded in the .pdf, but works with *.avi in the same folder as .pdf. Works with or without Acrobat Reader.