3

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.

bproxauf
  • 1,076
  • 12
  • 23

2 Answers2

5

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.

AlexG
  • 342
  • 4
  • 15
  • Thanks for your quick and concise answer. No reason to be sorry, though. Hmm, I don't recall giving such an OK. Also Adobe still asks me for each document with a video, whether I want to trust the pdf (once or permanently).. Anyways, so this means that a link to an external location (e.g. cloud storage) should be given for videos? Seems fine, I understand the risk of interactive content in a pdf. But just for curiosity: Are there any plans to allow embedding videos with a higher security standard than the notorious Flash player at some point in time? – bproxauf Nov 11 '20 at 15:31
  • And thanks of course nonetheless for the work and effort that you put into the package. It's great to be able to use such packages thanks to developers like you :) – bproxauf Nov 11 '20 at 15:38
  • 2
    And thank you for using the package! The video can also be a local file and linked with `\href{run:myvideo.mp4}{Click me!}`. Here, file `myvideo.mp4` is supposed to to be in the same directory as the PDF. Of course, "Click me!" can be replaced with `\includegraphics{...}` to provide a poster image. – AlexG Nov 11 '20 at 16:09
0

This solution works for me (Adobe Acrobat Reader 2021.001.20142): https://tex.stackexchange.com/questions/516029/media9-is-becoming-obsolete-dec-2020-any-alternatives-for-embedding-video-audio

  1. Go to Windows Settings > Display > Graphic Settings > Under Choose an App/ Browse >
  2. Add Acrobat.exe and edit the default from "Let Windows decide" to Power Saving Intel.
  3. Relaunch Acrobat.
  4. Try to play video.
Jacek
  • 1