I'm preparing a presentation using the beamer class and I want to add a mp4 video. Unfortunately, everything I tried seems to be broken:

  1. Try: Using the \movie command, pdflatex and okular: Doesn't work, because okular is buggy, sometimes plays the video too small.
  2. Try: Using htlatex. htlatex is broken.
  3. Try: Using \movie, building it using
latex $name
latex $name
dvisvgm --font-format=woff --exact --zoom=-1 -p1,- $name

and opening it using chromium. Chromium shows the slides, but won't play the video.

Is there a non broken way?


With Alex G answer:

$ dvisvgm --exact --zoom=-1 --font-format=woff2 --output=%f-%0p.svg main
pre-processing DVI file (format version 2)
processing page 1
  graphic size: 455.24408pt x 256.074799pt (159.999995mm x 89.999998mm)
  output written to main-1.svg
1 of 4 pages converted in 0.343285 seconds

UPDATE: This can be fixed using the --page argument.

But autoplay still won't work.

1 Answer 1


For a presentation in SVG format, you may give package media4svg a try.

Typeset with:

dvilualatex name
dvilualatex name
dvisvgm --bbox=papersize --font-format=woff2 --zoom=-1 --page=- --output=%f-%0p.svg name

and open name-1.svg in the (Chrome, Firefox, ...) browser.

Here is the example (source) that comes with the package (Click to see it in action):




% PageDown, PageUp key event handling; navigation symbols <--, -->
% mouse cursor autohide on idle
\setbeamertemplate{navigation symbols}{}
      <style>svg{cursor: none}</style>%
      <script type="text/javascript">%
        var svgRoot=document.getElementsByTagName('svg')[0];%
        var cursorTimer;%
        document.addEventListener('mousemove', function(e){%
          }else if(e.key=='PageUp'||e.key=='ArrowUp'||e.key=='ArrowLeft'){%

\title{Presentation example with embedded video}
\subtitle{Use a Web browser and press \keys{F11}}


Navigate with \keys{PageUp} \& \keys{PageDn}, toggle Full-Screen with \keys{F11}.\\[2ex]
To build this presentation from the source, run:\vspace{-2ex}
dvilualatex beamer-example
dvilualatex beamer-example
dvisvgm --bbox=papersize --font-format=woff2 --zoom=-1 --page=- --output=%f-%0p.svg \

\begin{frame}[fragile]{Video file}
  Embedded local video file from package \emph{mwe}

\begin{frame}[fragile]{Remote video}
  Video streamed from URL

\begin{frame}[fragile]{Player control}

The standard player controls (option `\verb+controls+') take a lot of space of the media display. Therefore, it is not recommended to enable them. Nevertheless, interactivity is still provided through touch or left mouse button click, and through the keyboard as summarized in the table.

Click on the media display to start playback. To pause playback, press the left mouse button on the media display. Release it to resume playback. To pause playback permanently, press the left mouse button on the media display and move the mouse out while keeping the button pressed.

  Command & Shortcut\\\hline
  \rule{0pt}{2.4ex}Toggle Play/Pause & \keys{\SPACE}\\
  Increase volume & \keys{\arrowkeyup}\\
  Decrease volume & \keys{\arrowkeydown}\\
  Unmute audio & \keys{Ctrl+\arrowkeyup}\\
  Mute audio & \keys{Ctrl+\arrowkeydown}\\
  Toggle Full-Screen & \keys{F11}
  Command & Shortcut\\\hline
  \rule{0pt}{2.4ex}Seek back \SI{1}{\percent} & \makebox[\widthof{\keys{\SPACE}}][l]{\keys{\arrowkeyleft}}\\
  Seek forward \SI{1}{\percent} & \keys{\arrowkeyright}\\
  Seek back \SI{10}{\percent} & \keys{Ctrl+\arrowkeyleft}\\
  Seek forward \SI{10}{\percent} & \keys{Ctrl+\arrowkeyright}\\
  Seek to beginning & \keys{Home}\\
  Seek to end & \keys{End}



Note: For having a video auto-play on page-open, it must be muted at the same time. This is for security reasons. Thus, ,autoplay,muted must be added to the option list of \includemedia.... (See texdoc media4svg.)

  • On my machine, this creates main-1.svg but not main-2.svg Commented Apr 30, 2021 at 13:01
  • Sorry, I forgot to include -p- option. (See edit.)
    – AlexG
    Commented Apr 30, 2021 at 13:04
  • @VolkerWeißmann Does the example work for you if you re-build it on your own?
    – AlexG
    Commented Apr 30, 2021 at 13:10
  • 1
    @VolkerWeißmann : This is because the video has the focus. First click Tab, then PgUp or PgDown.
    – AlexG
    Commented May 12, 2022 at 16:18
  • 1
    @VolkerWeißmann With the updated media4svg (v. 0.7, 2022/05/18), page up/down works immediately, even if the video has the focus.
    – AlexG
    Commented May 19, 2022 at 8:19

You must log in to answer this question.

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