I want to embed an mp4 video (with H.264 codec) into a pdf with Latex, using the media9 package. There are no error messages during compilation. Before activating the video in the pdf, there is a still image (as intended), but after activation, there is just a black window, without the video being played properly.
A minimal example to illustrate is given below. It is a shortened version of an Overleaf template for embedding mp4 files into pdf documents with Latex. I have attached the still image penguins.jpg to this question, but I cannot (or don't know how to) attach the video penguinschasingbutterfly.mp4 in stackoverflow
.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{media9}
\begin{document}
This is an .mp4 file:
% using a .mp4; downloaded from https://www.youtube.com/watch?v=-9iXD2-hbJM
\includemedia[width=0.6\linewidth,height=0.6\linewidth,activate=pageopen,
passcontext,
transparent,
addresource=penguinschasingbutterfly.mp4,
flashvars={source=penguinschasingbutterfly.mp4}
]{\includegraphics[width=0.6\linewidth]{penguins}}{VPlayer.swf}
\end{document}
Before activation the pdf looks like
After activation the pdf looks like
The same happens also with the video files in the media9 documentation and videos embedded in other pdfs. Other multimedia files found in the media9
documentation, such as audio files and 3D objects, do work as intended.
My pdf reader is Adobe Acrobat Reader DC (20.012.20048)
and I updated the Shockwave Flash plugin for my internet browser Mozilla Firefox to Shockwave Flash 32.0 r0
, as the media9 documentation mentions the Adobe Flash Player
plugin for Firefox among its requirements (Chapter 2).
What could be the reason for the black windows showing up and the videos not being displayed?
P.S.: If any other Latex package works well for videos within pdf files (even if outdated, like movie15
or multimedia
), this would be an alternative for me.