Skip to content

Instantly share code, notes, and snippets.

@totetmatt
Created January 17, 2020 08:29
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 totetmatt/e2f300e86a9e1891b7db5dc03d236e87 to your computer and use it in GitHub Desktop.
Save totetmatt/e2f300e86a9e1891b7db5dc03d236e87 to your computer and use it in GitHub Desktop.
Grab a video and create a gif from selected timestamp
# $1 = Video URL
# $2 = Time to start (format 00:00:00)
# $3 = Duration of sample (format 00:00:00)
# $4 = Output file
youtube-dl -f mp4 \
$1 \
-o - \
| ffmpeg -i pipe: \
-ss $2 \
-t $3 \
-vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse"\
-loop 0 -y \
$4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment