Created
January 4, 2015 20:01
-
-
Save hellocatfood/9e718566a25c0a84a7ea to your computer and use it in GitHub Desktop.
gif to video
This file contains 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
#!/bin/bash | |
for file in *.gif | |
do | |
# get filename minus extension | |
file1=$(basename "$file") | |
filename="${file1%.*}" | |
# convert to individual frames with green screen | |
convert -background "#00AB39" $file -alpha remove -coalesce temp_gif-%04d.png | |
# convert images to video. Replace avconv with ffmpeg if necessary | |
avconv -i temp_gif-%04d.png -vcodec mjpeg -q:v 0 "$file".mp4 | |
# clean the directory of temporary images | |
rm temp_gif*.png | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment