3

I have a set of files from which I would like to create a movie file with a certain frame rate. I can, however, not seem to find software that is able to do this.

I'm working under Ubuntu Linux. Ideally the movie would maintain the vector graphics format from the pdf. But I do not know if software exists which makes this possible. If this is impossible, I could also convert the pdf files to a nonvector format and produce a movie from it.

Does anybody have experience with this?

4 Answers 4

2

A tool to do that would be FFmpeg but unfortunately it does not support PDF decoding. Though you can convert your pdf's to png's using imagemagick (relevant question on askUbuntu).

And then create a movie out of those PNG's with ffmpeg. This guide on the ffmpeg page explains how, here an example command:

ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4

This read images from the current folder with the prefix "img" and a following number of 3 digits and display them for 5 seconds (-r 1/5) with a frame rate of 30 fps (-r 30).

1
  • Useful answer ;). Ubuntu does however state This program is only provided for compatibility and will be removed in a future release. Please use avconv instead., so this solution might not be useful anymore in future releases of Ubuntu. Furthermore, the -c:v option is not recognized.
    – Adriaan
    Commented Jul 10, 2014 at 8:37
2

Adobe Flash is designed to work with animating vector graphics and allowing playback of vector animations, but it requires that a user have Flash Player installed. I know there are third party Flash authoring applications out there, but I don't know what, if any, exist on Linux, or if they are still maintained as Flash has been falling out of favor all over the place and is completely unsupported on most mobile platforms.

Outside of that, video is generally a raster format, so you can't work directly with vector graphics without rasterizing them. If you rasterize your PDFs to an image sequence, then many video players and/or encoders can work with an image sequence. A lot will even automatically recognize it as a video if you name them the same with numbering. (Such as "myvideo00000.tga, myvideo00001.tga, myvideo00002.tga, etc.)

As Professor Sparkles pointed out, imagemagick and FFMPEG is one such option, but any combination of a tool that can convert PDFs to images and then a tool that can play or convert a series of images in to a video would work fine. (For example, in a pinch you could print the PDF to an image driver and then use Premiere or something similar to open the image sequence and output a video as well.

3
  • Should note that he is working on Linux, so working with Flash Pro is probably not an option.
    – timonsku
    Commented Jul 9, 2014 at 15:46
  • @ProfessorSparkles - right, any idea if there is any flash authoring alternative on Linux? I don't know linux well enough.
    – AJ Henderson
    Commented Jul 9, 2014 at 15:48
  • Not that I know of, pretty certain there is nothing native with even a huge lack of decent video cutting tools on linux. The only solution would be to user an old version of Flash Pro in Wine.
    – timonsku
    Commented Jul 9, 2014 at 16:24
1

Using the latex package animate, a movie consisting of vector graphics can be made.

Construct a set of, for instance, pdf files with a base name img- and construct the file main.tex containing the code

\documentclass{standalone}
\usepackage{animate}
\begin{document}
    \animategraphics[controls,autoplay,loop]{10}{img-}{1}{20}
\end{document}

. Compiling the main.tex file produces a pdf file with an embedded vector graphics movie. For playback, either Adobe Reader or PDF-XChange Viewer is needed. For more details, consider the manual of the animate package at The animate Package. For Linux users, I believe only Adobe Reader is an option. Follow the instructions at How do I install Adobe Acrobat Reader?.

1
  • +1. I like! No unnecessary and complicated installing of ffmpeg necessary for this one. Commented Jan 11, 2018 at 23:00
0

Assuming your PDF files are in your working directory, to create a movie file from a set of PDF files you can simply execute:

mogrify -verbose -density 500 -resize 800 -format png ./*.pdf 
convert -delay 600 *.png movie.mp4                               

This requires Imagemagick and Ghostscript to be installed. Works on Linux/Mac OS X/Microsoft Windows. Not vectorial.


FYI:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.