Take the 2-minute tour ×
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.

I need to play two videos at once on a slide - it is pretty straightforward to show a single video, however, if I want to show two videos on a single slide simultaneously, it doesn't work - only one video is running.

\frame
{
  \frametitle{Motivation}
  \begin{columns}
    \column{.5\textwidth}
       Video1
       \movie[label=show1, height=4cm, width=5cm,poster,autostart]{}{results1.avi}
    \column{.5\textwidth}
      Video2
      \movie[label=show2, height=4cm, width=5cm,poster,autostart]{}{results2.avi}
  \end{columns}
}

Any suggestions? thx...


alright, I have media9, however, I'm not able to play any video

\includemedia[
  addresource=results.avi,
  width=5cm, height=4cm,
  flashvars={
    source=results.avi
   &autoPlay=true
  }
]{\fbox{Play}}{VPlayer.swf}

results.avi is in the same folder as slides.tex, slides.pdf

what's wrong?

is there any simple example? I've already read the package documentation, however there are so many options, that I really don't need... Which player should I use?


alright, it seems that .flv does the job, however I have few more questions?

  1. How can I play it in a loop (add &loop=true below autoPlay doesn't work)?
  2. How can I show some menubar (play/pause, ...) - it isn't necessary to add the buttons into the pdf, show play/pause, etc. on hover is enough (e.g. similar behavior as flash player, etc.)
share|improve this question
    
Which PDF viewer on which platform do you use? –  AlexG Jun 1 '12 at 10:47
    
Adobe Reader, MacOS –  morph Jun 1 '12 at 10:49
    
Then use package media9 instead of beamer's multimedia. The latter implements the oldest media inclusion method for PDF, allowing for only one video playing at a time, the former the most recent inclusion method (AR-9/X), allowing for almost everything. –  AlexG Jun 1 '12 at 10:53
    
@morph Which PDF viewer do you use? –  Joseph Wright Jun 1 '12 at 11:43
    
Adobe Reader - I think that this one is the best –  morph Jun 1 '12 at 11:44
show 18 more comments

1 Answer

up vote 3 down vote accepted

First of all you need your video files in MP4 format with H.264 compression. See section 1 of the media9 documentation on how to recode existing video files / how to recreate them from bitmaps. AVI format is not supported.

To start two or more videos at once, a media button can be inserted that controls them all. Looping the videos is enabled by adding loop=true to the Flash variables:

\documentclass{article}
\usepackage{media9}

\begin{document}
\includemedia[
  label=vidA,
  addresource=results1.mp4,
  activate=pageopen,
  width=5cm, height=4cm,
  flashvars={
     source=results1.mp4
    &loop=true
  }
]{}{VPlayer.swf}

\includemedia[
  label=vidB,
  addresource=results2.mp4,
  activate=pageopen,
  width=5cm, height=4cm,
  flashvars={
     source=results2.mp4
    &loop=true
  }
]{}{VPlayer.swf}

\mediabutton[
  mediacommand=vidA:playPause,
  mediacommand=vidB:playPause
]{\fbox{Play/Pause}}
\end{document}
share|improve this answer
    
ok, thank you, but WHY do I need to recode the video to mp4? Why can't I use standard avi, etc.? I thought that media9 should be better package? I don't want to waste time with this... isn't there a better option? –  morph Jun 1 '12 at 12:55
    
The new method is better because VPlayer.swf (or any other Flash based player you may find on the web) displaying the video is run in the Reader built-in FlashPlayer. No dependency on external plug-ins that must be installed on the host computer and thus very reliable. FlashPlayer is capable of playing only a small number of video formats (FLV,MP4). MP4/H.264 probably the best combination currently available. –  AlexG Jun 1 '12 at 13:03
    
Make sure ffmpeg is indeed linked to libx264 library. You may also try flv (FlashVideo): ffmpeg -i orig.avi -sameq new.flv –  AlexG Jun 1 '12 at 13:07
    
thank you, it works, however I've updated my question –  morph Jun 1 '12 at 13:23
add comment

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.