gif to mp4

Convert GIF to MP4 for Instagram with FFmpeg

I made a script to account for Instagram’s idiosynchracies when converting a GIF to MP4 using FFmpeg. Here it is:

And now the details…

Doing a conversion of GIF to MP4 with ffmpeg seems like it should be simple enough:

But it isn’t! This can be insufficient in a couple of ways..

Problem 1: Video too short

instagram "video too short" notification

Solution: Use a filter to loop the input enough times to meet the 3s minimum time requirement

Problem 2: Wrong color encoding

Instagram blank video preview

Given a color encoding that it doesn’t understand, Instagram just kinda poops out

Solution: By default, my ffmpeg used yuv444p, which Instagram wasn’t happy with. I haven’t done an exhaustive survey of the color encoding that Instagram will accept, but here is one: yuv420p.

In addition, the conversion requires the file’s height to be divisible by 2, so we need yet another filter:


Now since so many GIFs that I wish to post to Instagram are actually shorter than 3s, I automated everything above and here is the first cut of the script. To see if I made any changes since actually using it “in production” check the version I’m currently using in my dotfiles.


To convert yup.gif to yup.mp4

To convert yup.gif into yup.insta.mp4

To create an insta.mp4 directly from a remote GIF

Happy giffing! 😀

My Puppet skeleton profile

This might come in handy for someone using Puppet with the “roles and profiles” design pattern. Having this profile sitting idly by to provide the boilerplate for a new profile has let us be lazy in a good way.


I made a thing: Memeseeks! (Rick & Morty memes and gifs)

Just in time for the new season of Rick & Morty (as well as our own episode on the matter), we just released this thing we’ve been working on:

The Memeseeks Box

Meeseeks Christopher and Colbert

The Memeseeks Box

It’s a Rick & Morty memer and giffer (pronounced like the peanut butter ?). We’ve been saying at Decipher Scifi that we were working on a few things behind the scenes, and this was one of them. I’m glad to finally have it out there. 🙂

So meme away, and I hope you like it, and make sure you’re subscribed to the podcast for our Rick & Morty episode in a few days!

<edit from the future> here is our Rick and Morty episode!</future>

I may post some codey things about it here in the future.