Advanced memelogy - Convert video to HD GIF

Updated: August 23, 2024

Several weeks ago, I told you about the "can't send video" problem in WhatsApp. You wanna share dank memes with your buddies, and technology be standin' in your way, fam, fr. Well, in that guide, I explained how you can work around the issue - by sending HD videos, duh. But then, if you only have SD quality content, what can you do? On the phone, it ain't trivial, but on the desktop, you have a range of options.

In today's wee tutorial, I will revisit an old and powerful media editing tool - ffmpeg, your one-stop shop for everything audio or video. This program lets you manipulate media files any which you want - convert among many different formats, split and join clips, scale, extract individual frames, add subtitles, change playback speed, and so much more. Well, let's talk about converting video into animated images, GIFs.

Teaser

Why would you want to do this?

Well, as I mentioned before, you might have a problem sharing video content with your friends, for whatever technological limitation in whatever program or app. In some scenarios, you may only be interested in the actual video part (no audio), and you may also face space/size restrictions or format restrictions. You may also want to embed clips in the chat, rather than offer them as downloadable files, as the former offers a more streamlined meme experience.

This led me onto a quest to see what I can do with video clips. Well, if you have SD content, you can still transcode it as HD. No problem. Similarly, you can convert video clips into GIF images. However, by default, such a conversion may not be pretty, and you could end up with low-res, non-looping files. This goes against the creed of respectable memeology.

Well, let's proceed then and convert videos files (say MP4, MOV) into GIFs ...

Ffmeg command line

The "easiest" way to do this, without online portals or downloading all sorts of weird apps to your phone, is to use the free, open-source ffmpeg utility (on the desktop). If you're a Linux user, it's available for installation straight from the repos. Windows users can just download the relevant executables from the official site, and go from there.

ffmpeg -i [input] -vf "fps=XX,scale=YYYY:-1:flags=lanczos" -loop 0 [output]

A more specific example:

ffmpeg -i Test.mov -vf "fps=24,scale=1920:-1:flags=lanczos" -loop 0 Test.gif

What do we have here?

scale=1920:1080

scale=-1:640

Let ffmpeg run, and job done. Some thumbnails, at your pleasure. Now, they don't really show the full extent of the "action", either video or GIF, but there's a big reason for that.

MOV file

Converted GIF

The reason? File size. My original video is a 5-sec clip, and it weighs 3.5 MB. The GIF weights 61.5 MB! I tried with a different clip, and there, the differences were slightly less cardinal, 86 vs 152 MB, but it all depends on the amount of information in the clip. To that end, I didn't add the actual artifacts here, as they would hog the bandwidth all too easily. Hint: there are ways around it, but we shall talk about that separately.

But there, we did it. Job done, memeification complete.

Conclusion

Ffmeg is a frighteningly complex and useful tool. With some 5,000 flags and options, give or take, you really can do anything and everything possible. You just need patience and tenancy, but when it comes to doing something with video or audio, look no farther. That's it. Today, we needed to make sweet GIFs, and there you have it.

The suggestions outlined above should help you become a more respectable memeista. This should also help you create high-quality content. The conversion principles are the same, regardless of the input and output formats, so if you need to make HD video out of SD video (so to speak), you can. I thought GIFs would be an even more avantgarde option. Well, for what it's worth, hopefully this was useful. Now ere we disperse, we shall have ANOTHER article on GIF memeing, and it will cover all the different methods on creating gif files, their advantages and such. Soon, soon. Dank away.

Cheers.