Convert a video to fast GIF using FFmpeg (Tutorial)

Here is a simple one-line command to turn a video into fast GIF:
ffmpeg -i input.mp4 -vf "setpts=0.5*PTS,scale=480:-1" -r 15 output.gif
How this works:
-i input.mp4: specifies your input video.
setpts=0.5*PTS: doubles the playback speed (half the presentation timestamps).
scale=480:-1: resizes the video width to 480 pixels while preserving aspect ratio.
-r 15: sets the GIF frame rate to 15 frames per second, which balances quality and file size.
output.gif: the name of the output file.
You can tweak the speed by changing 0.5 to smaller values for faster playback, for example 0.25*PTS to make it four times faster.