Created
October 25, 2016 14:59
-
-
Save eneim/2ff94e9894b5b10defa4263b1b853829 to your computer and use it in GitHub Desktop.
Mp4 to Gif
This file contains 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/sh | |
fps=$3 | |
res=$4 | |
palette="/tmp/palette.png" | |
filters="fps=$fps,scale=$res:-1:flags=bicubic" | |
palettegenops="stats_mode=diff" | |
paletteuseops="dither=none" | |
ffmpeg -v warning -i $1 -vf "$filters,palettegen=$palettegenops" -y $palette | |
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse=$paletteuseops" -y $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment