Skip to content

Instantly share code, notes, and snippets.

@felipepodesta
Forked from shazow/convert-gifs.sh
Created November 11, 2016 04:21
Show Gist options
  • Save felipepodesta/464c27319ca6d9be14fa18d1596e5c4a to your computer and use it in GitHub Desktop.
Save felipepodesta/464c27319ca6d9be14fa18d1596e5c4a to your computer and use it in GitHub Desktop.
Batch convert a directory of gifs into mp4
#!/usr/bin/bash
# Convert *.gif into *.mp4, skip if already exists.
outdir="."
for path in *.gif; do
out="${outdir}/${path/.gif/}.mp4"
[[ -f "$out" ]] && continue
ffmpeg -f gif -i "${path}" "${out}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment