Created
November 30, 2017 10:45
-
-
Save rewida17/f63802ca23b833a6b0d608363fc3bc0c to your computer and use it in GitHub Desktop.
FFMPEG GIF Create
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/bash | |
usage() | |
{ | |
echo -e "\\nUsage:\\n ./gifmake \\n [Wejściowe Wideo] [Nazwa Końcowa Pliku GIF] [Roździelczość Pozioma] [(fps)] [czas początku( HH:MM:SS.MSS)] [czas końca (HH:MM:SS.MSS) ]" | |
} | |
if [[ ( $@ == "--help") || $@ == "-h" ]] | |
then | |
usage | |
exit 0 | |
fi | |
palette="/tmp/palette.png" | |
filters="fps=$4,scale=$3:-1:flags=lanczos" | |
rm -rf /tmp/*mp4 "$palette" | |
cp "$1" /tmp/ | |
echo "format is a: ss.mss" | |
ffmpeg -v warning -ss "$5" -i /tmp/"$1" -to "$6" -c copy /tmp/prt.mp4 | |
#"$5"= time of start "$6"= duration in seconds | |
ffmpeg -v warning -i "/tmp/prt.mp4" -vf "$filters,palettegen" -y "$palette" | |
ffmpeg -v warning -i "/tmp/prt.mp4" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$2" | |
#ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y "$palette" | |
#ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$2" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment