[Tex/LaTex] Removing black spaces of embedded video in beamer

beamergraphicsmultimediatikz-pgf

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

Best Answer

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