I have to upvote this, since my video screenshoter (Ubuntu 22.04) is as well recording some .webm, and it would be nice to be able to directly drop them in the forum.
Hint for linux users :
I have put in my /home/myself/.local/share/nautilus/scripts/ a script so that it’s added to the context menu (right click). It ables to instant convert a .webm video to a .gif. I use to do it before sharing on this forum. I added a (pre-filled) prompt for resize and fps. Very handy !
#!/bin/bash
# Get the file path
FILE="$1"
# Get the directory and filename without extension
DIR=$(dirname "$FILE")
BASENAME=$(basename "$FILE")
FILENAME="${BASENAME%.*}"
# Default values
DEFAULT_FPS=15
DEFAULT_SCALE=640
# Get user input for fps and scale
FPS=$(zenity --entry --title="FPS Input" --text="Enter FPS:" --entry-text="$DEFAULT_FPS")
SCALE=$(zenity --entry --title="Scale Input" --text="Enter scale width (height will be auto-calculated):" --entry-text="$DEFAULT_SCALE")
# Check if user canceled
if [ -z "$FPS" ] || [ -z "$SCALE" ]; then
zenity --error --text="Conversion cancelled."
exit 1
fi
# Generate palette
PALETTE="${DIR}/${FILENAME}_palette.png"
ffmpeg -i "$FILE" -vf "fps=$FPS,scale=${SCALE}:-1:flags=lanczos,palettegen" -y "$PALETTE"
# Convert video to gif using the generated palette
OUTPUT="${DIR}/${FILENAME}.gif"
ffmpeg -i "$FILE" -i "$PALETTE" -filter_complex "fps=$FPS,scale=${SCALE}:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=sierra2_4a" -y "$OUTPUT"
# Remove the palette image
rm "$PALETTE"
# Notify user
zenity --info --text="GIF saved as $OUTPUT"