Watch Quicktime videos embedded with latex in a pdf in 2021

media9movie15pdf

My free physics book in pdf format contains many quicktime films. The book is written in LaTeX. It seems that Acrobat Reader does not support playing quicktime films any more. What can I do?

(To get an idea of the project and of the free files, 5 volumes with over 2000 pages, they can be downloaded at www.motionmountain.net . Search for "quicktime" to find the films inside the pdfs.)

I used the old movie15 package and the dvi-dvips-pdf route. (I did not manage to get the media9 package working.) Would changing the package help? Or is this a more general issue? Any advice is appreciated, as it would help the readers directly.

Best Answer

With regards to TeX, videos and PDF there are multiple things at play here:

  1. There are several different ways of embedding videos / multimedia into PDFs.
  2. There are also several (La)TeX packages, each package usually sticks to a certain "PDF multimedia mechanism".
  3. The PDF viewer's support for multimedia.

I guess that you are using Mac OS. Last time I heard, there the two PDF mechanisms that worked on Windows also worked there. That means that you should be able to use either movie15 or media9. Using media9 is the worse option, since AFAIK it still embeds Flash support files into PDF files, which nowadays can work with some compatibility mechanisms, but is unnecessary, since it doesn't bring any benefit. So you can't do better than movie15 (*1). That's points 1) and 2). But Acrobat calls the older mechanism used by movie15 "legacy" and last time I tried to use it, it had to be explicitly enabled in settings (under "Multimedia (legacy)") and even then it didn't work on my second machine. You could try this first.

As you can tell, the most troublesome part is the viewer support. Viewers don't generally implement video on their own, instead they use an external library or some system interface. On Windows PDF viewers tend to use "Windows Movie Player" to play the media, so limitations on video formats are inherited from it. In particular QuickTime (.mov) can't be played. I am not sure about Macs here. But I have notes about MP3, AVI, MP4, MPG and WMV formats working with both Acrobat Reader and Foxit Reader on Windows (both use Windows Movie Player there). In my experience Foxit's multimedia support is better. But this hints that you may find success with changing the format of your videos from QuickTime to something else. (*2)

Probably not that relevent to you, but there are also Linux solutions. I know about at least 4 viewers that offer some multimedia playback capabilities - Okular, Evince, pdfpc and pympress. The first two are general purpose PDF viewers and should handle movie15 style PDF multimedia just fine, provided that you have the right libraries installed:

  1. gstreamer
  2. gst-plugins-base
  3. gst-plugins-good
  4. gst-plugins-ugly
  5. gst-libav

or it is possible that your Okular version uses vlc instead.

The latter two viewers are aimed at presentations. I have not much experience with them, although I couldn't get pdfpc to work with my files. Pympress was better, and it also can use either gstreamer or vlc, although I remember the setup being non-straightforward. But it doesn't work with your files, because it wrongly interprets the multimedia file names / paths movie15 put in the PDF.

*1) Although, in particular movie15 makes playing videos embedded in your PDF files kind of hard in Evince, because movie15 places a file attachment annotation at the same place as the video, and Evince overlayd on top of it, which makes the video hard to click on.

EDIT (2021-10-21):

*2) Just today I retested the multimedia file type support on Windows. On a fresh installation of Acrobat and Foxit, I can get AVI, MP4, MPG, WMV to play with Foxit and only MPG with Acrobat. This is certainly a regression, since the formats I list above worked in both Acrobat and Foxit as of June 2021.

For reference, this is the test file I used (to be compiled with optex and the pdfextra package, the MIME type declartions will be part of the next version of pdfextra), the video.xxx and audio.xxx files are expected to be findable by TeX (e.g. in current directory):

\fontfam[lm]
\load[pdfextra]

\_pdfextra_mimetype{au}{audio/basic}
\_pdfextra_mimetype{aiff}{audio/x-aiff}
\_pdfextra_mimetype{mov}{video/quicktime}
\_pdfextra_mimetype{mpg}{video/mpeg}
\_pdfextra_mimetype{wmv}{video/x-ms-wmv}

\long\def\test#1{%
\_insec{#1\strut}

\render[#1][
  aactions=\renditionautoplay,
  controls=true,
]{\Black\vrule width\hsize height\hsize}

\vfil\break
}

\test{video.avi}
\test{video.mov}
\test{video.mp4}
\test{video.mpg}
\test{video.wmv}
\test{audio.aiff}
\test{audio.au}
\test{audio.mp3}
\test{audio.opus}

\bye
Related Question