This is a possible solution to generate a video from an animated .gif file. We could generate the set of .png images directly from the .pdf file instead of an intermediate .gif format, but let us not break the current work flow!
- Extract all frames from the animated
.gifas a set of.pngimages (all frames will be namedframefollowed by an integer reference indicating the current frame being extracted):
$ convert duck.gif frame%05d.png
- Generate an
.avivideo from the frame set (the video filter is intended to slow down the animation; observe that the float value indicates the speed factor: if less than 1, the speed will be faster, or slower otherwise):
$ ffmpeg -i frame%05d.png -filter:v "setpts=3.0*PTS" duck.avi
- Remove all
.pngimages used to compose the video:
$ rm frame*.png
And we have a duck.avi video!