问题
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.
回答1:
Adobe stops Flash support by the end of 2020.
Once, somewhere in the (not so far) past, you may have given your OK to stop using Flash anymore in Acrobat Reader. You were asked this in a pop-up window while you wanted to play an embedded video. From that decision on, or from 1/1/2021 the latest, video and audio playback will depend on the media plugin of your OS, which is flaky in most cases. Plus, there won't be any means of player configuration available anymore, such as "loop", "controls", "autoplay" etc.
As Joel Geraci puts it in one of his answers in the Acrobat support forum, now, best-practice is linking videos instead of embedding them.
I am sorry for this regression :(.
Disclaimer: I am the author of the media9 LaTeX package.
来源:https://stackoverflow.com/questions/64787733/video-embedded-into-pdf-with-latex-does-not-play-correctly