Created
February 18, 2021 19:57
-
-
Save Mike-Dunton/aea852bdccf13b0cb1cd79360c357fa4 to your computer and use it in GitHub Desktop.
My GIF workflow
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
alias yt-dl='docker run \ | |
--rm -i \ | |
-e PGID=$(id -g) \ | |
-e PUID=$(id -u) \ | |
-v "$(pwd)":/workdir:rw \ | |
mikenye/youtube-dl' | |
alias ffmpeg-dkr='docker run --rm \ | |
--entrypoint ffmpeg \ | |
-v $(pwd):/config \ | |
-w="/config" \ | |
starefossen/gifsicle:ffmpeg' | |
gifify() { | |
ffmpeg-dkr -i $1 -s 600x400 -ss $2 -t $3 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.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
yt-dl "https://www.youtube.com/watch?v=YOUTUBE-ID" -o "FileName.%(ext)s" | |
## using a custom output so I can avoid spaces in the filename | |
## gifify <file-name.ext> <start-time-stamp> <duration> | |
gifify FileName.mp4 00:03:32.000 00:00:15.000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dependencies: