Creating my own reaction GIFs (with ffmpeg)
Just keeping a note here. Will update this post later.
I’ve been creating a fun set of my own “reaction GIFs”, just for fun. The first drafts seemed pretty popular so far, and caught people off guard. 😆
More on the process later.
Once I had sliced up a video into a series of reactions, and named them each, I had a folder of files like:
- oh-my.mp4
- shocked.mp4
- eeeeee.mp4
- yeeeeahh.mp4
- woot.mp4
And this is the command that is working for me so far:
for file in *.mp4; do ffmpeg -i $file -vf "scale=-1:300:force_original_aspect_ratio=decrease" -r 15 ${file%.*}.gif; done
The bare command, without the loop:
ffmpeg -i example.mp4 -vf "scale=-1:300:force_original_aspect_ratio=decrease" -r 15 example.gif
Couple details:
- This maintains the nearly-square aspect ratio that I exported, but making sure the output is 300px high or less.
-r 15
sets the frame-rate down to 15fps. For a gif, this saves a massive amount of file-size. I saw no reason to keep all 25 or more fps from the original, 720p video recording.