Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Mike-Dunton
Created February 18, 2021 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mike-Dunton/aea852bdccf13b0cb1cd79360c357fa4 to your computer and use it in GitHub Desktop.
Save Mike-Dunton/aea852bdccf13b0cb1cd79360c357fa4 to your computer and use it in GitHub Desktop.
My GIF workflow
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
}
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
@Mike-Dunton
Copy link
Author

Dependencies:

  • Docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment