1

It's the first time that I'm using beamer to prepare my defense presentation. This is the beamer template that I'm using : template (pdflatex version). In fact, I need to include several videos (.avi) in my presentation. I've already tried the different ways proposed in this question. None of them worked :

\begin{frame}{test.video}
 \includemedia[activate=pageopen,
 width=200pt,height=150pt]{}{resources/video.avi}
 \end{frame}

or

\begin{frame}{test.video}
\movie[width=8cm,height=4.5cm]{play the video}{video.avi}
\end{frame}

or

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

\begin{frame}{test.video}
\includemedia[
  activate=pageopen,
  width=200pt,height=150pt,
  addresource=video.avi,
  flashvars={%
     source=video.avi% same path as in addresource!
%   &autoPlay=true%    % optional configuration
%   &loop=true%        % variables
  }
  ]{}{VPlayer.swf}
\end{frame}

and the last one that I tried and was unsuccessful :

\begin{frame}{test.video}
\includemovie{.85\textheight}{.85\textheight}{video.mp4}%
\end{frame}

They all create a white empty box that does not do anything. I have converted the videos to .mp4, this did not help either. I have installed flash-player for adobe (version 2019.010.20091). My operating system is : macOS High Sierra V. 10.13.6. Your help would be greatly appreciated.

  • 1
    Which PDF viewer do you use? Do the video examples in the media9 manual play? – AlexG Feb 20 '19 at 11:25
  • I use Adobe Acrobat Reader DC (version 2019.010.20091). No, they do not work unfortunately. – Basilique Feb 20 '19 at 11:28
  • If you click the link, the media9 manual most likely opens in the Web browser, not in AR DC. Download the PDF and open it in AR DC directly. Then, the video examples should play, provided that Flash Player was properly installed. – AlexG Feb 20 '19 at 11:31
  • Yes, they work perfectly when I open the file using AR DC. – Basilique Feb 20 '19 at 11:41
  • 1
    Ok. Now, convert your avi to MP4. Take the code from the first box in https://tex.stackexchange.com/a/345433/36296 and paste it into an empty *.tex file. In the code, replace the m4v file with your MP4 file, compile and open PDF in AR DC. – AlexG Feb 20 '19 at 11:54
  • I did so. It creates the pdf with the playable box, but this error pops up : unable to play 'video.mp4'. – Basilique Feb 20 '19 at 12:10
  • How did you convert to video.mp4? Are you working on Overleaf? If so, would you mind sharing a link to the project? Maybe there is something wrong with the encoding of your MP4. – AlexG Feb 20 '19 at 12:14
  • In fact, I used an application that I had (Free MP4 Convertor). do you think that the problem is with the conversion? since when I play the .mp4 with VLC, there is no problem. I created the .avi video using this command ffmpeg -start_number 01 -stream_loop -1 -i frame%02d.png video.avi from a series of frames that were created by gnu plot. – Basilique Feb 20 '19 at 12:21
  • Oh, nice that you are using ffmpeg! Use it to produce the correct MP4 directly from the source PNG files acc. to page 2 of the media9 manual: ffmpeg -i frame%02d.png -c:v libx264 -profile:v high -pix_fmt yuv420p -g 30 -r 30 video.mp4 – AlexG Feb 20 '19 at 12:28
  • Thank you @AlexG. You know, it does not create the video.mp4 from my terminal. there is an error : [image2 @ 0x7fb083800000] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options – Basilique Feb 20 '19 at 13:04

1 Answers1

1

You mentioned in a comment that you generated the video from a series of images. Instead of trying to include the video, I would simply include the images directly.

A short example:

\documentclass{beamer}
\usepackage{xmpmulti}
\begin{document}

    %asuming you images are called "something-0.png" up to "something-16.png" 
    \begin{frame}
        \transduration<0-16>{0}
        \multiinclude[<+->][format=png, graphics={width=\textwidth}]{something}
    \end{frame}

\end{document}

enter image description here

  • I tried but the pdf do not act as a continuous image. Your image is a gif. How can I get a gif from the generated pdf? – juan Jul 12 '20 at 10:05