3

From this question, there is a way to include images with a hyperlink using the media9 package included in TeXLive. I am trying to include a GIF image (supported directly by the media9 package) in a beamer slide:

    \begin{frame}
        \frametitle{Motivation from photography}
            \includemedia[
            width=0.3\linewidth,keepaspectratio,
            activate=onclick,
            %addresource=config.xml, %embedded configuration
            addresource=../../../../Documents/Horse_galloping.gif, %embedded image file
            %flashvars={xml=config.xml},
            %passcontext %show the player’s context menu
            ]{}{StrobeMediaPlayback.swf}
    \end{frame}

I still have some trouble: my tex file compiled successfully but when I opened the pdf file (adobe reader; Foxit doesn't show the gif image) and clicked on the window, it showed the following error: "we are unable to connect to the content you've requested. We apologize for the inconvenience" (TypeError - Error#1009). Some background: I compiled with pdflatex-biber-pdflatex-pdflatex sequence. I called the media9 package by

\usepackage{media9}
Huy Nguyen
  • 131
  • 1
  • 2
  • This not use media9 package, but maybe works ... http://tex.stackexchange.com/questions/74073/gif-image-in-beamer-presentation – juanuni May 16 '15 at 04:09
  • I checked the link out. I think it is a good option. However, I'd like to know a direct way of inserting a gif image. The method in the link is a longer piece of code I think. There gotta be a shorter way – Huy Nguyen May 16 '15 at 06:06
  • If it is a single, to-be-embedded image file, why don't you convert the GIF to PNG and insert that using \includegraphics as usual? Is it animated GIF? Note that the media9 based method relies on using the Flash Player plugin in Adobe Reader which doesn't support animated GIFs. Moreover your code cannot work. StrobeMediaPlayback isn't the right app, use SlideShow.swf as in the answer you cited. – AlexG May 16 '15 at 10:43
  • I think you are right about the app which should be SlideShow.swf. On the other hand, I am trying to insert an animated gif. I missed the fact that media9 doesn't support anjmated gifs. Do you have a suggestion on the package that might work? – Huy Nguyen May 16 '15 at 14:14
  • @HuyNguyen the second response in link is relatively short to use gif in beamer – juanuni May 17 '15 at 02:15

1 Answers1

0

I've been trying to use GIF images with media9 as well without success. In the end, I was able to include the animation using an MP4 video instead. Turning a GIF into an MP4 is easy, you can use kdenlive for this. Once you have the MP4 file, you can include the animation as follows:

\begin{frame}
\includemedia[
    width=.3\linewidth,
    height=.3\linewidth,
    addresource=../../../../Documents/Horse_galloping.gif,
    transparent,
    activate=pageopen,
    passcontext,
    flashvars={
        source=../../../../Documents/Horse_galloping.gif
        &loop=true
    }
]{}{VPlayer.swf}
\end{frame}

Not the best solution, but it works. On the bright side, the MP4 file uses less space than the actual GIF, which is a plus.

gvegayon
  • 101
  • 3