Skip to content
Permalink
b0e9b4c25e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
53 lines (45 sloc) 1.45 KB
import os, time
def editable():
for file in os.listdir("/To Transcode/"):
if file not in os.listdir("/Editable Footage/"):
print("Converting editing file " + file + "...")
toTranscode = "ffmpeg -i /To\ Transcode/" + file + " -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 25 /Editable\ Footage/" + file
os.system(toTranscode)
print("Finished converting editing file" + file + "\n")
Transcode()
def renderFile():
for file in os.listdir("/To Transcode/"):
if file not in os.listdir("/Transcoded Footage/"):
print("Converting video file " + file + "...")
toTranscode = "ffmpeg -i /To\ Transcode/" + file + " /Transcoded\ Footage/" + file
os.system(toTranscode)
print("Finished converting video file" + file + "\n")
Transcode()
def wait():
empty = True
while empty == True:
os.system("clear")
print("Waiting for files...")
if os.listdir("/To Transcode/"):
for file in os.listdir("/To Transcode/"):
if file not in os.listdir("/Transcoded Footage/"):
empty = False
time.sleep(10)
def Transcode():
editable()
renderFile()
wait()
Transcode()
if not os.path.isdir("/To Transcode/"):
os.mkdir("/To Transcode/")
if not os.path.isdir("/Editable Footage/"):
os.mkdir("/Editable Footage/")
if not os.path.isdir("/Transcoded Footage/"):
os.mkdir("/Transcoded Footage/")
try:
os.system("ffmpeg -version")
except:
print("ffmpeg not installed")
os.system("sudo apt-get install ffmpeg")
exit()
Transcode()