Quick animations from slides for youtube.

Some things are better shown in motion. Full stop. In a paper, you can only present still images, but linking a youtube video with a supplemental animation is certainly an acceptable option nowadays.

So I created a quick and dirty animation from slides I had prepared already a while ago. The result is puristic (no audio comment, no fine tuning), but I managed to get it in less than 40 min effort, including some trial and error and uploads.

So here’s the three simple steps to create a quick-and-dirty animation from you existing (pdf) slides.

pdftk slides.pdf burst

To split into pages.

for x in pg*pdf
    convert -density 400 $x "${x%pdf}png"

Create raster images using imagemagick; density adjusts the resolution.

mencoder mf://*.png -mf fps=1:type=png -ovc copy -oac copy -o output.avi

Create video with one slide per second; adjust fps if not appropriate

Check out my result on youtube.

For embedding the animation in a website, a gif image might be more handy; that is just another command away:

convert -geometry 40% -delay 100 -loop 0 pg*png output.gif

Here, -loop 0 means infinitly repeat loop, -delay 100 is a 1 second delay (as we used it for the video above). The -geometry 40% is optional, but for most applications, the gif should be a substantially smaller file, so reducing the resolution is a good idea here.