0

I have a video.avi movie that I have converted to video.mp4 with ffmpeg using libx264 as follows:

ffmpeg -i video.avi -c:v libx264 -profile:v high -pix_fmt yuv420p -g 30 -r 30 video.mp4

Now I have tried to include it in a tex document "full screen mode" with media9. Minimal code:

\documentclass[
    paper=128mm:96mm,
    fontsize=9pt,
    pagesize,
    parskip=half-,
    numbers=noendperiod,
    captions=nooneline 
    ]{scrartcl}
\usepackage{graphicx}
\usepackage{media9}

\begin{document}
\thispagestyle{empty}
\begin{figure}[p]
\centering
\vspace*{-1.36cm} % to be in the right place
    \includemedia[
          height=\paperheight,
          activate=pageopen,        
          keepaspectratio,
          transparent,
          playbutton=plain,
          addresource=video.mp4,
          flashvars={
              source=video.mp4 
             &autoPlay=true
             &loop=true}
             ]{}{VPlayer.swf}
\end{figure}
\end{document}

This just produced a blank page, in newest Adobe Acrobat Reader for Windows with security settings disabled and multimedia enabled. Where do you think the problem lies? Thanks for the help.

1 Answer 1

2

Look at the terminal output of the LaTeX run. It tells you that the media annotation has zero width:

*************************************************
* media9 warning: "zero width"
* 
* Media annotation on line 28 has zero width.
* 
* Provide a poster text with non-zero width or
* set a valid one using the `width' option.
*************************************************

Therefore you get a blank page.

The warning message gives you instructions about what to do:

Either

  1. providing a poster text

or

  1. providing a non-zero width using the width option.

If you set the height only (height=\paperheight in your example), you need to also provide a poster text, such as \includegraphics{something} as the last-but-one argument of \includemedia:

\includemedia[
          height=\paperheight,
          activate=pageopen,        
          keepaspectratio,
          transparent,
          playbutton=plain,
          addresource=video.mp4,
          flashvars={
              source=video.mp4 
             &autoPlay=true
             &loop=true}
             ]{\includegraphics{example-image}}{VPlayer.swf}

You must log in to answer this question.

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