7

I have written the following document

\documentclass[aspectratio=1610]{beamer}

\usetheme[hideallsubsections]{Berkeley}
\useinnertheme{rounded}
\usepackage{multimedia}
\title[]{{\scshape Infodag wiskunde}}
\date{{\scshape 16 maart 2013}}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}\label{chaosfrag1}\frametitle{{\scshape Chaos 1 - }}
\begin{center}
\movie[showcontrols]{\includegraphics[width=0.8\textwidth]{chaos1.png}}{chaos1.mpg}
\end{center}
\end{frame}

\end{document}

For some reason however, neither Adobe Reader nor Foxit PDF Reader are able to display the movie on click. I figured the issue was probably with the pdf readers, but last year I made a similar document, and though I no longer have the TeXcode, I still have the pdf, and this does work. (the embedded media there is also .mpg). I already tried different media types (.avi, .mp4, .flv) but none of them work.

I know about the media9 package, however, as my final document will contain about 18 movies of each 10 minutes, the resulting pdf would be 2GB. Whenever I open it, it takes at least 10 seconds to start playing the media, and even then, it doesn't work (I just get a gray rectangle).

EDIT: Okay, appearantly i was using a wrong code for media9, so now I can play the video (though the filesize still is huge). But still, it would be nice to see if I made a mistake somewhere in the \movie command or something...

I hope someone can help :)

AlexG
  • 54,894
janker
  • 173
  • 1
  • 1
  • 5
  • 1
    You may try to run a lightweight web server, such as nginx, on your presentation laptop. This allows you to play video files from the local hard disc instead of embedded ones using the media9 package. Loading is much faster then, because files don't need be extracted and decompressed. Read on here. – AlexG Mar 12 '13 at 12:30
  • I personally never use embedded video in my beamer presentation: I use always external viewers (VLC) to play the movies. The advantages are that the PDF is smaller and I am not limited by the codecs. The main inconvenient is that you have to keep to all the files at the right place... – Lionel MANSUY Mar 12 '13 at 12:36
  • @AlexG : I'm not sure I get what you mean. I was currently using \includemedia[ addresource=chaos1.mp4, flashvars={ source=chaos1.mp4 &autoPlay=true &scaleMode=letterbox } ]{\includegraphics[width=0.8\textwidth]{chaos1.png}}{VPlayer.swf}

    But this still embeds into the pdf (pdf size is still huge).

    – janker Mar 12 '13 at 12:55
  • 1
    Option addresource=... embeds the video file, and FlashVar source=... lets VPlayer.swf know what to play. What you want is source=http://localhost/chaos1.mp4 without addresource (no embedding). For this to work you will have to run a web server, as explained in the topic linked in my first comment. – AlexG Mar 12 '13 at 13:12
  • Alternatively, you may upload the video file to a file sharing service, such as dropbox, and set source to the remote URL of the video file. Playback will start while a large video file is still being downloaded. – AlexG Mar 12 '13 at 14:51
  • Could somebody please provide a working minimal example with source code and compiled PDF? – Martin Thoma Mar 13 '13 at 17:33
  • @moose: Using what, multimedia or media9? – AlexG Mar 14 '13 at 08:19
  • If possible, for both one example. And I would really like to add them to my LaTeX example repository. – Martin Thoma Mar 14 '13 at 11:07
  • @moose: multimedia example see below. media9 example with external (not embedded) video file, see here. – AlexG Mar 14 '13 at 12:08
  • @AlexG: Both answer do not contain the compiled PDF. – Martin Thoma Mar 14 '13 at 17:27
  • @moose: In this forum file attachments are not possible. – AlexG Mar 15 '13 at 08:04
  • There are many services where you can upload files. If you don't like any of them you could sent them to me (info@martin-thoma.de) and I'll post a link to them in my GitHub repository. – Martin Thoma Mar 15 '13 at 09:49

1 Answers1

9

With multimedia, only videos in the AVI format, encoded using one of the standard codecs available on Windows (MS Video 1, Full Frames (Uncompressed)) will successfully play on Windows. MPEG does definitely not work.

\movie{\includegraphics[width=0.8\textwidth]{chaos1.png}}{chaos1.avi}

I successfully produced an AVI from a BMP sequence using pjBmp2Avi.exe and selecting 'MS Video 1'.

AlexG
  • 54,894
  • I will probably have used a wrong codec, but still, will probably use your nginx solution! Thanks :) – janker Mar 14 '13 at 17:46
  • This answer really helped steer me in the right direction when I was having a problem with this issue..thank you! Some things to add: Using Windows 7 with Adobe Acrobat Reader DC. I could get videos in the AVI container to work. The only audio codec I had success with was "pcm_u8" (PCM unsigned 8-bit). For the video codec, success came after I downloaded the "ffdshow" codec package (from SourceForge) to the Windows machine and activated just ffdshow's "Other MPEG4" format (which included the needed "FMP4" codec (FYI, ffmpeg calls this "mpeg4 (Simple Profile))". Running out of room... – Digger Jan 21 '16 at 21:14
  • (continuation from the above comment) FYI, videos that were "cropped" at the beginning did not work until I placed the -ss option in front of the input file specification (FWIW, this was when using Beamer's Multimedia package's "poster" option). – Digger Jan 21 '16 at 21:19
  • I can say that the "rawvideo" ffmpeg video codec works, but, of course, the resultant video files are huge when using this. Will report later if the cinepak codec works. – Digger Jan 23 '16 at 23:42
  • Why don't you use package media9 and embed H.264 video? – AlexG Jan 24 '16 at 19:34
  • @AlexG - I'm trying to have success with the multimedia package. – Digger Feb 15 '16 at 04:58
  • I can report that with the above-mentioned setup (Windows 7 with Adobe Acrobat Reader DC), I found two additional audio codecs that work: "adpcm_ima_wav" (ADPCM IMA WAV) and "adpcm_ms" (ADPCM Microsoft). – Digger Feb 15 '16 at 05:02
  • FYI, in order to get the videos to play on a Windows 7 machine, I needed to add "Everyone" to the "Group or user names" of one of the parent folders. – Digger Feb 19 '16 at 22:35