6

I have video tutorials that I want to show in my presentation with beamer class. I don't want the video files get embedded to the PDF because they will make the PDF size very very huge.

If you know how the videos can be played on the HTML with a reference rather than embedding the video file to the HTML file, I want something like this to be applied to my PDF presentation. I just want to reference the video URL from my PDF presentation.

Shortly speaking, can we use media9 to show a video on a PDF but the video is not embedded to the PDF?

Uploading those videos to a web server might be difficult for me because internet connection is very slow and sometimes not available in the presentation room. :-)

4
  • 2
    You could use the package multimedia which comes with beamer. It enables you to embed a link to an external multimedia file such as movies or audio files into your beamer presentation. Have a look at chapter 14 "Animations, Sounds, and Slide Transitions" of the beamer manual.
    – SFAB
    Sep 18, 2012 at 6:22
  • 2
    You could put the video files on a web server and refer to their URL via the source Flash variable of the embedded video player. Besides not working with the shipped version of VPlayer.swf, local video files which are separate from the PDF don't make sense in my opinion. Without them the PDF is useless; distributing them along with the PDF is cumbersome and doesn't save disk space.
    – AlexG
    Sep 18, 2012 at 6:59
  • @AlexG: Separating the videos in a dedicated, shared folder makes sense because I can reuse the same videos for many LaTeX projects, what do you think? Sep 18, 2012 at 7:20
  • 2
    I am afraid that putting the video files on a web server (which could be a local one running on your machine) is the only option you have with media9. Security measures of Adobe Reader prevent the built-in FlashPlayer from accessing files on the local disk. Only embedded files and those specified as a web URL are supported.
    – AlexG
    Sep 18, 2012 at 8:39

1 Answer 1

8

Security measures of Adobe Reader prevent the built-in FlashPlayer from accessing files on the local disk. Only embedded files and those specified as a web URL are supported. However, a web server may be running on the local machine, serving media files residing in a dedicated folder.

Setting up a lightweight web server on a presentation laptop is easy.

I tested Nginx (open-source, BSD License) on Windows 7. It only needs to be unzipped, and nginx.exe can be started immediately without administration privileges. Media files to be served are put into the html subdirectory of the unzipped nginx-1.*.* directory.

Running a local web server may be beneficial in case of large media files, which will load much faster than big embedded files. Embedded files need to be completely extracted and uncompressed first before they can be loaded and displayed.

A minimal working example reads:

\documentclass{article}
\usepackage{media9}

\begin{document}
  \includemedia[
    width=0.6\linewidth,height=0.45\linewidth,
    activate=pageopen,
    flashvars={
       source=http://localhost/random.mp4
      &loop=true
    }
  ]{}{VPlayer.swf}
\end{document}

random.mp4 from the media9 installation was copied into the nginx-1.*.*/html directory.

7
  • I will install IIS 7.5 on my Windows 7 machine and create a virtual directory for a folder in which the videos exist. Sep 18, 2012 at 14:40
  • Mission accomplished! Sep 18, 2012 at 15:04
  • 1
    @GarbageCollector: Congratulations.
    – AlexG
    Sep 18, 2012 at 15:06
  • 1
    @GarbageCollector: MP4 (preferably using H.264 codec) and FLV. Here are some instructions
    – AlexG
    Sep 18, 2012 at 15:12
  • 1
    @GarbageCollector: TeX cannot read media files and thus cannot determine video dimensions. The user has to provide the information. Some video players and processing tools can give you this information. If you have the raw image files the video was produced of at hand, you can \includegraphics one of them as the poster argument of \includemedia. This will scale the player size appropriately.
    – AlexG
    Sep 19, 2012 at 10:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .