Commands for making GIF:
ffmpeg -i demo.mkv -vf "palettegen" videoPalette.png
ffmpeg -i demo.mkv -i videoPalette.png -lavfi "fps=25 [x]; [x][1:v] paletteuse" -y demo.gif