Skip to content

Instantly share code, notes, and snippets.

@tjb0607
tjb0607 / vid2gif.sh
Created December 30, 2023 23:36
vid2gif.sh - uses ffmpeg and gifsicle to convert a video to a gif within a filesize constraint
#!/bin/bash
echo "Usage: vid2gif.sh <input> <output>"
echo -n "Enter desired delay (1/100 of seconds): "
read delay
fps=$(expr 100 / $delay)
read -p "Enter width [default: -1]: " width
width=${width:--1}
read -p "Enter height [default: -1]: " height
height=${height:--1}
read -p "Enter start timestamp [default: 0]: " tstart