Last active
January 22, 2024 10:13
-
-
Save shazow/dcb5c6744d1837bed6d2 to your computer and use it in GitHub Desktop.
Batch convert a directory of gifs into mp4
This file contains hidden or 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
#!/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
@qwksilver You'll need to use something like
find
to get all the gifs. Rough sketch:Then do the rest of the changes you want. :)