Sometimes I want to show my screencasts, but the site I want to showcase them doesn’t accept the .mov format that my screencast outputs. A good example is GitHub.

Now, it comes in handy to be able to turn .mov files into animated .gifs


  • palettegen
  • ffmpeg

The shell file or whatever you want to name it:

cd $PWD
mkdir -p ./gifs
for file in *
    if [[ $file =~ ^(.*)\.mov$ ]]; then
      echo Transforming $file ...
      ffmpeg -i $file -vf palettegen temp_palette.png
      ffmpeg -i $file -i temp_palette.png -filter_complex "fps=10,scale=1280:-1[x];[x][1:v]paletteuse" ./gifs/$newfile
      rm -f temp_palette.png

The above shell script needs to be in the same folder as the .mov files that you want to make into animated .gif files.

The script creates a new directory gifs/, which contain the newly created animated .gif files.

I’ll add more to this