How to save animations as mp4 videos and animated GIFs