Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Some time ago I asked this question How to include a movie in a PDF? Step by step instructions. (I tried everything documented there, and links therein. I can't find the combination of tools to be able to playback embedded movies in a PDF viewer in Linux.)

This time I am going to be more direct: Was anyone, with a certain combination of tools and viewer, able to create a PDF from TeX with an embedded movie and play it back in a Linux viewer (for example some version of Acrobat)?

If, so what package, tex version, acrobat version was used?

share|improve this question

2 Answers

up vote 9 down vote accepted

Update Thanks to @percusse for pointing out in his comment that the original answer was not the one the OP was asking for.

So I did a little searching and found this link. Basically, the workaround is,

  1. Install Adobe Reader 9.4.1.
  2. Install flashmovie or copy it to your source folder (especially the player_flv_maxi.swf)
  3. Write \includepackage{hyperref} and \includepackage{flashmovie} in your preamble. A minimal working environment would be:

    \documentclass{article}
    
    \includepackage{hyperref}
    \incldepackage{flashmovie}
    
    \begin{document}
    
    \flashmovie[width=12cm,height=8cm,engine=flv-player,auto=1]{movie.flv}
    
    \end{document}
    

It seems that, in Linux, you can only get embedded videos in Acrobat with Acrobat version 9.4.1. (Why this is, I don't know yet.) You will also need to install ffmpeg to convert your videos to flv

I downloaded the sample text-flv.tex file from the link. How flashmovie works is summarized in this file.

I can verify the claim of that the movie cannot play on the output pdf on my Adobe Reader with version 9.4.7. Opening the pdf gives a message A 3d data parsing error has ocurred. I can also verify that it works like a charm in Adobe Reader 9.4.1.

BTW, I have TeX version 3.1415926-2.4-1.40.13.

Update: If you are not after embeding First, make sure that you have installed all required packages to run your movie format. You will need to load the package movie15, which comes with TeXLive 2012. The manual says that this package is already obsolete and that you should consider using movie9 instead, which is in ctan but not in TeXLive2012. I used movie15 in this answer.

Try the following MWE:

\documentclass{article}

\usepackage{hyperref}
\usepackage{movie15}

\begin{document}

    \begin{figure}[ht]
    \includemovie[poster,text={\small(Loading Video...)}]{3cm}{2cm}{movie.mp4}
    \end{figure}

\end{document}

The poster option inserts the first frame of the movie. The text option appears before the movie is loaded into your pdf viewer. 3cm and 2cm are the width and height of the frame and movie.mp4 is the name of your movie.

Run pdflatex movie.tex where movie.tex is your tex file. I am using Ubuntu 12.04 and I use evince 3.4 to view the pdf. Just type evince movie.pdf in your terminal. Click on the frame to play the movie. The movie will open with your default movie viewer.

I haven't tried movie9 though.

Update This is in response to User 17791. My previous comment to his answer was deleted when the question was edited by moderator. Here it is, @User17791:

pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012)
kpathsea version 6.1.0
Copyright 2012 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.10; using libpng 1.5.10
Compiled with zlib 1.2.7; using zlib 1.2.7
Compiled with xpdf version 3.03

Below are two snapshots of my desktop with a movie being played in Acrobat 9.4.1. (It's a video of a ritual dance here in Baguio City.)

enter image description here

enter image description here

share|improve this answer
2  
This is nice but OP specifically asks for embedded playback. – percusse Aug 18 '12 at 7:26
1  
Thanks hpesoj626 for your detailed answers. I have succeeded in getting a beamer+flashmovie+AR 9.4.1 to work, creating an avi movie from jpg images using mencoder, and converting the avi movie to mp4 with ffmpeg. My distro was Fedora 16 When I say to work, I mean I was able to put AR in presentation mode, and clicking on the image, the movie played. I was able to pause the movie also. BUT: Unfortunately, I have some days ago upgraded to Fedora 17. Repeating all the steps, I am able to see the movie in presentation mode, but when I want to change to the next slide, AR crashes. So, now I am comp – user17778 Aug 19 '12 at 17:48
1  
hpesoj626, could you please post the output of pdflatex -v ? So I can compare the libraries it is compiled against, and I am able to figure out why AR crashes,even following all your steps. Thanks in advance! – user17791 Aug 20 '12 at 2:38
@Fiz65, I am sorry but I have never even tried using Fedora. Did you still have the same settings for AR and your TeX though? – hpesoj626 Aug 23 '12 at 3:53
Thanks, I think you hit the nail on the head: Acrobat Reader 9.4.1 and flashmovie is the only combination in which I was successful in embedding (displaying) movies in PDF, and only with the default players (not the fancy ones). I did not succeed using movie15 or media9 yet. Also I can confirm some crashes when changing pages that Fiz65 reported. – alfC Sep 9 '12 at 9:26
show 4 more comments

Combination of media9, AdobeReader-9.4.1, player_flv_maxi.swf and a video file in the MP4+h.264 format (random.mp4 from the media9 documentation).

player_flv_maxi.swf seems to be bugged, as FlashVar loop only works if autoplay was set at the same time. Configuration FlashVars are all documented on the player's website:

\documentclass{article}
\usepackage{media9}

\begin{document}

\includemedia[
  width=0.4\linewidth,
  height=0.3\linewidth,
  activate=pageopen,
  addresource=random.mp4,
  flashvars={
    flv=random.mp4
   &autoplay=1
   &showplayer=autohide
   &loop=1
  }
]{}{player_flv_maxi.swf}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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