Initial Commit

This commit is contained in:
sebgab 2020-05-08 15:32:23 +02:00
parent 6009749402
commit 1f932b8370
3 changed files with 26 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
ImagesIn
ImagesOut

24
convert.py Normal file
View File

@ -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.")

BIN
ffmpeg.exe Normal file

Binary file not shown.