Add video to gif transcoding

This commit is contained in:
David Heinemeier Hansson
2026-05-03 19:16:16 +02:00
parent a700806f91
commit 10165f2799
+5
View File
@@ -8,6 +8,11 @@ transcode-video-4K() {
ffmpeg -i "$1" -c:v libx265 -preset slow -crf 24 -c:a aac -b:a 192k "${1%.*}-optimized.mp4"
}
# Transcode a video to an animated GIF using a palette for accurate colors
transcode-video-gif() {
ffmpeg -i "$1" -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" "${1%.*}.gif"
}
# Transcode any image to JPG image that's great for shrinking wallpapers
img2jpg() {
img="$1"