0

Some of the animations I export to animated gif with FFmpeg have long pauses where the frames are identical. Is there a way for FFmpeg to detect this and encode them as a single frame with a longer pause period? In other words, combine identical frames. I currently use

-vf palettegen=stats_mode=full
-f gif -lavfi paletteuse=diff_mode=rectangle:dither=none -loop -1

The file sizes are quite large as a result. Optimizing them with ezgif makes them a lot smaller by combining the frames.

1 Answers1

0

While not using ffmpeg, you can try accomplishing that with another popular command line tool ImageMagick.

This tool is way more opt for image processing/manipulation then is ffmpeg (which is for video stuff), and seems to be what the ezgif site most likely uses in the background.

See their Remove Duplicate Frames option (and all the other optmizitions there):
https://imagemagick.org/Usage/anim_opt/#removedups

Yisroel Tech
  • 13,220