1

Studying the documentation of media9 package left me with the impression that it should be possible to embed an SWF-video into a slide set to be shown by Adobe Reader. Unfortunately that document contained no examples that I could find, so I'm half-guessing the syntax.

This is the first time I'm trying to embed a video, so don't assume that I know anything.

Here's the source code:

\documentclass{powerdot}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
%\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[finnish]{babel}
\usepackage{amsmath,amssymb}
%\usepackage{psfrag}
\usepackage{media9}
\begin{document}
\begin{slide}{Animation}
\includemedia[
      width=250pt,
      activate=pageopen,
      addresource=ellipsi.swf,
      flashvars={source=ellipsi.swf}
    ]{}{VPlayer.swf}
\end{slide}
\end{document}

The file ellipsi.swf was exported from Mathematica9, and resides in the same directory as this TeX-source.

System: MikTeX ver 2.9, WinEdt ver 7.0, Windows 7

When I click TeX->LaTeX, this compiles all right. The DVI->PS conversion also goes smoothly. But clicking PS2PDF causes a slide of errors starting with

Error: /undefinedresult in --currentpoint

and ending with

MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1.

Usually I include psfrag substitutions in still images, so that's why I'm used to going the DVI->PS->PDF route. I also tried a direct DVI2PDF, but it gave

** WARNING ** 50 memory objects still allocated
You may want to report this to tex-k@tug.org

Mind you that last message does not concern me much, because I always get that if I hit DVI2PDF, usually with a lower number of allocated memory objects though.

2
  1. VPlayer.swf is only for playing back MP4/H.264 video files and provides some basic interactivity (play/pause/resume, seeking, speaker volume level) via mouse-click, keyboard, and additional buttons (to be inserted with the \mediabutton command).

    If you have an swf file with embedded video like your ellipsi.swf you must embed this one as the main file, that is, instead of VPlayer.swf, not as a resource. But then you will only have the interactivity that ellipsi.swf provides. I don't know anything about the Flash files Mathematica produces.

  2. List item Error: /undefinedresult in --currentpoint.

    Since you don't specify a poster text or image (empty argument {} before the last {VPlayer.swf}), you must provide width and height of the video as command options.

Thus, a working example would be:

\documentclass{powerdot}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
%\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage[finnish]{babel}
\usepackage{amsmath,amssymb}
%\usepackage{psfrag}
\usepackage{media9}

\begin{document}
\begin{slide}{Animation}
\includemedia[
  width=250pt, height=200pt,
  activate=pageopen,
]{}{ellipsi.swf}
\end{slide}
\end{document}

However, your best bet would be to produce an MP4+H.264 video file, e. g. using FFmpeg, and play it back with VPlayer.swf.

  • Thanks for the explanation and the suggestion. This did get rid of the error messages. Unfortunately something seems to be wrong with my swf-file, so I will need to do more testing. – Jyrki Lahtonen Nov 25 '13 at 15:44
  • It turned out that I had made a silly error in the Mathematica code producing the .swf-file. The error affected a single frame only, so was not really visible in Mathematica. But the error message text was so wide, that it set the bounding box (or whatever) of the .swf-movie so far to the right that the actual animation was to the left of the screen. Toying with the parameters described by Alex, and zooming heavily in AdobeReader made me figure out what else had gone wrong. So thanks once more, question resolved. – Jyrki Lahtonen Nov 25 '13 at 18:30
  • The Mathematica coding error was noticed by Jason B of Mathematica.SE. – Jyrki Lahtonen Nov 25 '13 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.