Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DIY How to make your own HD Animated GIF Generator

HD Animated GIF Generator

You can make your own HD animated GIF generator.
Follow along with these commands to get started.

HD Animated GIF Generator

git clone git://
cd ffmpeg
./configure --disable-yasm ## may need to disable yasm
sudo make install

Create the HD Animated GIF Generator

Make a new file called hd-gif and add the following text.


## echo
## echo "USAGE"
## echo
## echo "./hd-gif source.mp4 dest.gif FPS RESOLUTION"
## echo "./hd-gif video.mp4 animated.gif 30 480"
## echo


#echo "./ffmpeg -v warning -i $1 -vf $filters,palettegen=$paletteops -y $palette"
./ffmpeg -v warning -i $1 -vf "$filters,palettegen=$paletteops" -y $palette
./ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2

Make Executable: chmod +x hd-gif

Now you can use your hd-gif script like this: ./hd-gif video.mkv anim.gif 24 480

Source Blog

Upload to imgur for Hosting and .webm

You will finally want to upload to to provide free hosting and easy quick links. If your gif is over 7mb then Imgur will convert it to WebM format for performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment