-- Leo's gemini proxy
-- Connecting to republic.circumlunar.space:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
Here's a little script I wrote to avoid copy-pasting the ffmpeg command from superuser every time I needed it.
It converts a video to a GIF file by pre-calculating a good palette, then using that palette.
Usage:
./to_gif input.mp4 output.gif
The file to_gif (which should be executable):
#!/bin/bash set -e set -u # Credit: https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality INPUT="$1" OUTPUT="$2" PALETTE=$(mktemp --suffix=.png) ffmpeg -y -i "${INPUT}" -vf palettegen "${PALETTE}" ffmpeg -y -i "${INPUT}" -i "${PALETTE}" \ -filter_complex "fps=15,paletteuse" "${OUTPUT}" rm -f "${PALETTE}"
Note: you might want to modify the number after fps= to adjust how fast the video plays.
Update : changed to use mktemp instead of tempfile.
Originally posted at 2019-03-05 00:17:45+00:00. Automatically generated from the original post : apologies for the errors introduced.
-- Response ended
-- Page fetched on Sun May 19 06:32:01 2024