-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (32 loc) · 1.11 KB
/
main.py
File metadata and controls
40 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
from util.renameFiles import renameFiles
from util.prepareImages import prepareImages
from util.createVideo import createVideo
import prompt
print("Enter the Keyword:")
keyword = prompt.string()
print("")
print("Enter the Cropped Offset:")
offset = prompt.integer()
print("")
print("Enter the Image Duration:")
duration = prompt.string()
print("")
print("Enter the Output file (example: output, if you want file to be output.mp4):")
output = prompt.string()
print("")
success = renameFiles()
print("Renaimed all files to fit!", end='\r')
if success:
for (dirpath, dirnames, filenames) in os.walk("images"):
for file in filenames:
if file.endswith(".png"):
print("Processing " + file + " ", end='\r')
prepareImages(keyword, file, offset)
print("Creating the final video...", end='\r')
createVideo(float(duration), output)
for (dirpath, dirnames, filenames) in os.walk("cache/cropped"):
for file in filenames:
if file.endswith(".png"):
os.remove(dirpath + '/' + file)
print("Finished!")