7

I am experiences some issues when including videos in my beamer presentation. Here is my frame,

\begin{frame}{Frame Title}
\movie[width=6cm,height=4.5cm]{}{videos/test.avi}
\end{frame}

The problem occurs when I set the width and the height of the video. When I enter Presentation-mode of my PDF-viewer, black spaces occur at the sides of the video.

Is there a way to completely get rid of these?

I tried forcing the background color to white before the frame (\setbeamercolor{background canvas}{bg=white}), but that didn't solve the issue.


MWE:

\documentclass[11pt]{beamer}

\usepackage{multimedia}


\usepackage{tabularx}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{gensymb}

\begin{document}

\begin{frame}
\end{frame}

\begin{frame}{Frame 1}
\movie[poster,autostart,width=6cm,height=4.5cm,repeat=true]{}{rho.avi}
\end{frame}

\end{document}

The video is here: https://ufile.io/fb2de


Screenshot:

enter image description here

16
  • Maybe have a look at tex.stackexchange.com/a/143102/36296, this shows how to include full width images. But if your video has another aspect ratio then the presentation, some margins are inevitable. Dec 19, 2016 at 10:03
  • @samcarter Is it possible to override the margins, maybe by setting the background color or some other "dirty" trick?
    – BillyJean
    Dec 19, 2016 at 10:08
  • Can you make a compilable MWE that can reproduce your situation. Maybe with some dummy video we can access? Dec 19, 2016 at 10:22
  • @samcarter added a mwe with a video. when I enter presentation-mode with my pdf-viewer, black margins occur.
    – BillyJean
    Dec 19, 2016 at 10:33
  • 1
    This kind of animation could as well be embedded using the animate package, if you have the files of the single frames (preferably as original vector graphics) available.
    – AlexG
    Dec 19, 2016 at 11:09

1 Answer 1

5
+250

You can use the media9 package instead of multimedia (comes with beamer), which requires to convert your video to .mp4 first (e.g. here or wherever). It's worth the effort as media9 allows to include the video physically in the PDF, means you don't need to carry around the actual video file and you're not dependent on any codecs available on the target PC (which would be the case with an external .avi file and multimedia).

\documentclass[11pt]{beamer}

\usepackage{media9}

\usepackage{tabularx}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{gensymb}

\begin{document}

\begin{frame}
\end{frame}

\begin{frame}{Frame 1}
    \includemedia[
          width=6cm,height=4.5cm,
          activate=pageopen,        
          keepaspectratio,          % optionally useful
          transparent,              % optionally useful
          playbutton=plain,
          addresource=rho.mp4,
          flashvars={
              source=rho.mp4 
             &autoPlay=true
             &loop=true}
        ]{}{VPlayer.swf}
\end{frame}

\end{document}

enter image description here

8
  • 4
    In case the player's and the video's aspect ratios don't match exactly (due to resampling of the video while viewing) it is worthwhile adding option transparent. It makes the player's background transparent and further reduces the occurrence of black lines around the video
    – AlexG
    Jan 3, 2017 at 12:31
  • Thanks. I tried out your example with rho.mp4, but in the PDF nothing plays - it only shows a grey bar with a play-triangle inside it. Nothing happens though when I push it. Is the part VPlayer.swf correct?
    – BillyJean
    Jan 3, 2017 at 12:47
  • 2
    @BillyJean : Okular doesn't support the embedding method of media9. And only the Windows version of Foxit works.
    – AlexG
    Jan 3, 2017 at 13:37
  • 2
    @BillyJean : Installing and running A-Reader and FlashPlayer in Wine under Linux could be an option for you.
    – AlexG
    Jan 3, 2017 at 16:06
  • 1
    @BillyJean I'm sorry, but I didn't knew there would be issues with other pdf readers. Unfortunately I can't provide another solution for them. Jan 3, 2017 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .