When I first returned to Tumblr two years ago, I made gifs (well, .webp's) by taking screenshots in VLC while the video played and importing them to GIMP. A waste of time that also led to spotty, irregular frames depending on how my graphics card and memory were. Editing colors in GIMP also would have surely led to repetitive strain injuries since I've yet to find a method or a plugin to apply filters to every layer.
These days, I use mpv to watch video since it pairs nicely with mpd and playerctl, and ffmpeg for editing and extraction. Truly, I can't be bothered to gif anything of significant length anymore, so I tend to cut clips and upload .mp4's instead.
Calling this a "cheat sheet" is generous. I have only two commands to share.
To extract frames for GIFs:
ffmpeg \
-i input.mkv \
-ss 00:00:00 -to 00:00:00 \
-r 12 \
-q:v 2 \
frame%03d.jpg
-ss: position as start to end time. I find this easier than-tfor duration and tend to keep the video open in mpv as I'm typing the command to get the timestamps right.-r: video frame rate-q:v: alias for--qscale:v, selects video quality/filesize from 1-31.
To cut clips:
ffmpeg \
-i input.mkv \
-ss 00:00:00 -to 00:00:00 \
-c copy \ # OR -vf "scale=1280:720" \
output.mp4
-vf: I only use this is filesize is a problem.-c copy: Preserves the original dimesions.-vf "scale=1280:720": Scales them down.