[Tex/LaTex] How to include multimedia files in beamer

beamermedia9multimediavideo

A quick survey of the unanswered questions suggestions that about 20% of them are about problems with including multimedia files, such as videos or sound files. Many of them are about either using the wrong method for their file type (or the wrong file kind for their method) or use an unsuitable pdf viewer. Maybe this question can help to organise the information a bit.

There are different ways to include multimedia files in , which one work and which ones do not highly depends on the pdf viewer you use and the operating system you are on.

This questions tries to summarize the main information about the different packages which can be used, one answer per package.

Packages covered in this Q&A:

Tools/Viewers covered in this Q&A:

Useful Q&As on this site:

Best Answer

media9 package

  • information can be found in the documentation
  • usage (2code examples to be compiled as separate documents):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% player (`VPlayer.swf`) and video resource (`eso50supernova.m4v`)
% embedded in the document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{beamer}
\usepackage{media9}

\begin{document}
\begin{frame}{embedded files}

\includemedia[
  width=0.4\linewidth,
  totalheight=0.225\linewidth,
  activate=pageopen,
  passcontext,  %show VPlayer's right-click menu
  addresource=eso50supernova.m4v,
  flashvars={
    %important: same path as in `addresource'
    source=eso50supernova.m4v
  }
]{\fbox{Click!}}{VPlayer.swf}

\end{frame}
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% player (`VPlayer.swf`) and video resource (`eso50supernova.m4v`)
% loaded from web urls during viewing time
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{beamer}
\usepackage{media9}

\begin{document}
\begin{frame}{remote files}

\includemedia[
  width=0.4\linewidth,
  totalheight=0.225\linewidth,
  activate=pageopen,
  passcontext,  %show VPlayer's right-click menu
  flashvars={
    source=https://cdn.eso.org/videos/medium_podcast/eso50supernova.m4v
  }
]{\fbox{Click!}}{http://mirrors.ctan.org/macros/latex/contrib/media9/players/VPlayer.swf}

\end{frame}
\end{document}
  • file types:

    • SWF (Flash); PRC, U3D (3D content, local files only)
    • MP4 (h264 encoded), FLV, MP3 via configurable media players, e. g. VPlayer.swf and APlayer.swf bundled with media9
    • any file type a user-provided SWF app can digest; example: the slide show viewer SlideShow.swf bundled with media9, example on TeX-SX
  • important note:

  • viewer:

    • Windows: Acrobat Reader, Foxit (configuration), PDF-XChange, all requiring Adobe Flash Player plugin for Firefox (not the ActiveX version)
    • Linux (x86): only outdated Adobe-Reader-9.4.1 and using VPlayer9.swf/APlayer9.swf is available natively, Current adobe reader and flash can be installed via wine (see https://tex.stackexchange.com/a/446179/36296)
    • OSX: Acrobat Reader (Adobe Flash Player plugin required)
    • mobile: not supported