The (New) Complete Guide to Embedded Videos in Beamer under Linux

We used to use a pdf/flashvideo trick. It was terrible. This is so. much. better:

Update: pdfpc is now at a recent version in apt.

1) Install

sudo apt-get install pdf-presenter-console

2) Test it with my example: [on github] [local copy]

# use -w to run in windowed mode
pdfpc -w video_example.pdf

3) You need a poster image for every movie. Here’s my script to automatically generate all images in the “videos” directory (give it as its only argument the path containing a “videos” directory that it should search.) Only runs on *.avi files, but that’s a choice, not a avconv limitation.

#!/bin/bash

for file in `find $1/videos/ -type f -name "*.avi"`; do
#for file in `find $1/videos/ -type f -`; do
    
    # check to see if a poster already exists
    
    if [ ! -e "${file/.avi}.jpg" ]
    then
        # make a poster
        #echo $file
        avconv -i $file -vframes 1 -an -f image2 -y ${file/.avi/}.jpg
    fi
done

4) Now include your movies in your .tex. I use an extra style file that makes this easy: extrabeamercmds.sty (github repo). Include that (\usepackage{extrabeamercmds} with it in the same directory as your .tex) and then:

\fullFrameMovieAvi{videos/myvideo}

or for a non-avi / other poster file:

\fullFrameMovie{videos/myvideo.avi}{videos/myvideo.jpg}

If you want to include the movie yourself, here’s the code:

\href{run:myvideo.avi?autostart&loop}{\includegraphics[width=\paperwidth,height=0.5625\paperwidth]{myposter.jpg}}

Installing from source:

1) Install dependencies:

sudo apt-get install cmake libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgee-0.8-dev librsvg2-dev libpoppler-glib-dev libgtk2.0-dev libgtk-3-dev gstreamer1.0-*

Install new version of valac:

sudo add-apt-repository ppa:vala-team
sudo apt-get update
sudo apt-get install valac-0.30

2) Download pdfpc:

git clone https://github.com/pdfpc/pdfpc.git

3) Build it:

cd pdfpc
mkdir build
cd build
cmake ../
make -j8
sudo make install

Thanks to Jenny for her help on this one!

12/2/13