yihui / animation

A gallery of animations in statistics and utilities to create animations

Home Page:https://yihui.org/animation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

long animations not working with saveGIF

JeromeMathieuEcology opened this issue · comments

Hi,

When I try to make an animated plot with many steps (many images), saveGIF throw an error :
"command line too long".

I think it is because the command sent to convert contains the list of the images to work on, and it is too long for large animations.

Perhaps it could be handled by sending instead something like
convert *.png -delay 3 -loop 0 binom.gif

Here's Microsoft's page on similar problem
https://support.microsoft.com/en-us/kb/830473

Is there a way to fix this issue?
Thanks,
Jerome

How many images do you used in making a animation?

Both ImageMagick and GraphicsMagick may have a limit on the number of images to be converted. It is a known issue that this function can fail with more than (approximately) 9000 images. The function saveVideo is a better alternative in such a case.

I found a solution see thomasp85/gganimate#47
You have to use ImageMagick internal filename globbing by quoting your filenames (note the quoted "*.png"):

convert "*.png" -delay 3 -loop 0 binom.gif