Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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") | ||
exit() | ||
|
||
Transcode() | ||
|