Converting .mp4 to gif

sudo apt-get install libav-tools

To convert an .mp4 to .pngs:

avconv -i 160122-babobus-insta1.mp4 -r 10 output%05d.png

To convert the .pngs to .gif:

convert -delay 80 -loop 0 *.png babo1.gif

To convert an .mp4 to ogv - (-q:v sets video quality between 1 and 10. Higher value means higher quality. -q:a sets audio quality between 1 and 10. Higher value means higher quality.

avconv -i 160122-babobus-insta1.mp4 -c:v libtheora -c:a libvorbis -q:v 6 -q:a 5 -f ogg babo.ogv