Created
August 4, 2016 23:14
-
-
Save hafriedlander/fe8a8ea122815c4cd22115ccada7bf48 to your computer and use it in GitHub Desktop.
Reminder on creating a bunch of HQ gifs from a video
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 | |
palette='/tmp/palette.png' | |
filters='fps=15,scale=240:320:flags=lanczos' | |
dur=`echo "$2-$1" | bc` | |
ffmpeg -ss $1 -t $dur -i Cropped.mp4 -vf "$filters,palettegen" -y $palette | |
ffmpeg -ss $1 -t $dur -i Cropped.mp4 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse=dither=none" -y '/tmp/gif.gif' | |
gifsicle '/tmp/gif.gif' --optimize=100 > $3 |
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
ffmpeg -i ~/Movies/Source.mp4 -filter:v "crop=480:640:280:260" Cropped.mp4 | |
ffmpeg -i Cropped.mp4 -vf "drawtext=fontfile=/Library/Fonts/Arial.ttf: text=%{pts}: x=(w-tw)/2: y=h-(2*lh): fontcolor=white" Coded.mp4 | |
./extract {start_time} {end_tile} out.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment