-
-
Save wyattearp/5185e43d479cbbe80b7c016421795581 to your computer and use it in GitHub Desktop.
High quality gifs on Linux from OctoPrint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# used for turning octoprint items into timelapse gifs. | |
# usage ./mkgif.sh <input_movie> <output_gif> | |
# - error checking is for people who type things poorly :) | |
FPS=10 | |
# Option 1 | |
# http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality | |
PALETTE="pallet-$1.png" | |
ffmpeg -y -i $1 -vf fps=$FPS,scale=800:-1:flags=lanczos,palettegen "$PALETTE" | |
ffmpeg -i $1 -i "$PALETTE" -filter_complex "fps=$FPS,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" $2 | |
rm $PALETTE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment