Skip to content

Instantly share code, notes, and snippets.

@pavel-kirienko
Created June 9, 2020 15:42
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 pavel-kirienko/7d4482d310eed847ef096b896425d1ef to your computer and use it in GitHub Desktop.
Save pavel-kirienko/7d4482d310eed847ef096b896425d1ef to your computer and use it in GitHub Desktop.
Convert video to gif
#!/bin/bash
# Convert all video files in the current directory into gifs.
# Silently overwrite existing files.
# This is useful for working with matplotlib animations.
for src in *.mp4
do
bn="${src%.*}"
echo "$src $bn"
ffmpeg -y -i "$src" "${bn}.gif" || exit 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment