Gif to webm command line

Here is an alias to copy / paste if you want convert your gifs on the fly

I found this trick on this page of the Google documentation and I did my alias to convert the gifs on the fly. The webm converted file size is much much smaller.

The alias I put in my ~/.bashrc :

alias giftowebm() {
  ffmpeg -i $1 -c vp9 -b:v 0 -crf 41 $1.webm

I use it like this (for example, the gif was 4.1M):

giftowebm sphinx_directives_style.gif

It produces a 159k webm video file:


ffmpeg package

You will need the ffmpeg package to make this works. Here is a link to a page describing the easy procedure to install the ffmpeg package.

If this trick was usefull to you, you can buy me a coffee if you want (choose the price of the coffee) via 😉 Thanks !