Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Transforming Videos into GIFs for Slides

Published on

Updated on

Warning: This post has not been modified for over 2 years. For technical posts, make sure that it is still relevant.

I like using GIFs in Google Slides because it doesn’t require any interaction to start playing right away. Therefore, I looked at a couple resources to add a GIF from a video into my presentation. Of course this is all using one of my favorite terminal tools ffmpeg.

First of all, I wanted to include a video of a bot playing Pong. The video was a little long, so I decided speed it up for a more time-lapse type feel.

From the FFMPEG website: To 10x the speed ffmpeg -i input.mkv -filter:v "setpts=0.1*PTS" output.mkv

You just need to replace the 0.1 with the appropriate decimal number to change the speed.

Giphy has a great writeup describing the commands to use in order to make your GIF look nice.

ffmpeg -i inputvideo.mp4 -filter_complex "[0:v] palettegen" palette.png
ffmpeg -i inputvideo.mp4 -i palette.png -filter_complex "[0:v][1:v] paletteuse" output.gif
Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter

Published a response to this? :