diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..05c333a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ImagesIn +ImagesOut diff --git a/convert.py b/convert.py new file mode 100644 index 0000000..6d33ce8 --- /dev/null +++ b/convert.py @@ -0,0 +1,24 @@ +#!/usr/bin/python3 + + +from os import listdir, system +from os.path import isfile, join + +mypath="ImagesIn" + +onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] + +#print("Here are the files in the Images folder") +for f in onlyfiles: +# print(f) +# print("Converting " + f + " from WebM to GIF.") +# system("ffmpeg.exe -i \"ImagesIn\\" + f + "\" \"ImagesOut\\" + f + ".gif\"") + print(f[-4:]) + if f[-4:] == ".mp4": + print(f + " is an mp4 file, converting to GIF.") + system("ffmpeg.exe -i \"ImagesIn\\" + f + "\" \"ImagesOut\\" + f[:-4] + ".gif\"") + elif f[-5:] == ".webm": + print(f + " is a WebM file, converting to GIF.") + system("ffmpeg.exe -i \"ImagesIn\\" + f + "\" \"ImagesOut\\" + f[:-5] + ".gif\"") + +#print("And that was all the files.") diff --git a/ffmpeg.exe b/ffmpeg.exe new file mode 100644 index 0000000..9db315c Binary files /dev/null and b/ffmpeg.exe differ