Last active
June 27, 2022 17:03
-
-
Save discatte/3de08bfe6b3d8c26c08890c2325089ae to your computer and use it in GitHub Desktop.
ffmpeg optimized animated gif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gif optimization based on | |
# https://cassidy.codes/blog/2017/04/25/ffmpeg-frames-to-gif-optimization/ | |
# http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
# https://github.com/intgr/keep-on-giffing | |
ffmpeg -i "my_frames_%03d.png" \ | |
-vf "palettegen=stats_mode=diff:max_colors=256" \ | |
"my_palette.png" | |
ffmpeg -i "my_frames_%03d.png" \ | |
-i "my_palette.png" \ | |
-lavfi "paletteuse=dither=bayer:diff_mode=rectangle" \ | |
"my_animation.gif" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment