# transition from movie15.sty to media9.sty

• recently, a message popped-up :

Package movie15 Warning: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
(movie15)                @@ Package movie15' is obsolete and @@
(movie15)                @@ superseded by media9'.           @@
(movie15)                @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.


Warning

This post is certainly obsolete...

• a first read to the manual (texdocmedia9), seemed to be a regression, as it could do more complicated stuff (reading youtube files from within a PDF) but not the simple stuff you really use (I will never read a youtube files from within a PDF ...). In addition, the movie15 package was removed from texlive, so you have to make the transition (this was easily fixed by downloading a copy of movie15.sty)

• to make the change, you have to change the lines which are like:

\includemovie[label=aperture_aperture,poster=figures/aperture_aperture.png,mouse,repeat,autoplay]{\linewidth}{.75\linewidth}{./figures/aperture_aperture.mp4}

• by something like:

\includemedia[
width=\linewidth,height=0.75\linewidth,
activate=pageopen,
flashvars={
source=./figures/aperture_aperture.mp4 % same path as in addresource!
&loop=true % loop video
}
]{}{VPlayer.swf}

• an interesting perspective is to use 3D objects generated by asymptote:

\includemedia[
width=0.8\linewidth,height=0.8\linewidth,
activate=pageopen,
% 3Dcoo, 3Droo values found with ‘Generate Default View’ from
3Dcoo=-21.371112823486328 -19.702425003051758 -395.4008483886719,
3Droo=472.3543474473915,
3Dc2c=4 2 3
]{}{epix.prc}

• one solution for a smooth transition is my case where I need to just show a movie and nothing too fancy, one can create a command in the preamble like:

\newcommand{\includemovie}[3]{%
\includemedia[
width=#1,height=#2,
activate=pageopen,
flashvars={
source=#3 % same path as in addresource!
&loop=true % loop video
}
]{}{VPlayer.swf}
}

• and then use something like:

\includemovie{\linewidth}{.75\linewidth}{./figures/aperture_aperture.mp4}

• Video files must be in the MP4 format. Videos in other formats must be converted to MP4 or recreated from the raw material. The H.246 codec gives high quality video at stunningly small file size. With ffmpeg, video files can be created easily.

From an existing video file, such as Sample.avi:

ffmpeg -i Sample.avi -vcodec libx264 Sample.mp4

From a numbered sequence of bitmaps, such as frame-0.png, frame-1.png, ... :

ffmpeg -i frame-%d.png -vcodec libx264 myvideo.mp4