Cleaned up the output by discarding ffmpeg's output

This commit is contained in:
WORD559 committed 2018-07-05 20:35:30 +01:00
1 parent 16fe17eb1d
commit ba9b9ccc4c
1 file changed
+9 -6
+9 -6
View File
@@ -864,7 +864,8 @@ if __name__ == '__main__':
export_command.pop(8) export_command.pop(8)
else: else:
has_bgm = True has_bgm = True
subprocess.call(export_command) with open(os.devnull) as null:
subprocess.call(export_command,stdout=null,stderr=null)
print "Done!" print "Done!"
# These are the ffmpeg commands I need for each sound effect # These are the ffmpeg commands I need for each sound effect
@@ -882,7 +883,7 @@ if __name__ == '__main__':
## else: ## else:
# Read in the sound effect usage data # Read in the sound effect usage data
print "Reading in sound effect usage..." print "Reading sound effect usage..."
with open("{path}/sounds/SFX usage.txt".format(path=tempdir),"r") as sfx_usage_file: with open("{path}/sounds/SFX usage.txt".format(path=tempdir),"r") as sfx_usage_file:
sfx_usage = sfx_usage_file.read().split("\n") sfx_usage = sfx_usage_file.read().split("\n")
print "Done!" print "Done!"
@@ -894,11 +895,13 @@ if __name__ == '__main__':
sfx = line.split(":")[1].strip() if line.strip() != "" else "" sfx = line.split(":")[1].strip() if line.strip() != "" else ""
if sfx != "": # If a sound effect must be played... if sfx != "": # If a sound effect must be played...
length = frame*fps length = frame*fps
print "Adding "+sfx+" {length} seconds in.".format(length=length) print "Adding "+sfx+" at {length} seconds into the video.".format(length=length)
# ...run each command in series with the correct arguments # ...run each command in series with the correct arguments
subprocess.call([i.format(path=tempdir,sfx=sfx,length=length) for i in silence_command]) with open(os.devnull,"w") as null:
subprocess.call([i.format(path=tempdir,sfx=sfx) for i in SFX_command]) subprocess.call([i.format(path=tempdir,sfx=sfx,length=length) for i in silence_command],stdout=null,stderr=null)
subprocess.call([i.format(path=tempdir) for i in merge_command]) subprocess.call([i.format(path=tempdir,sfx=sfx) for i in SFX_command],stdout=null,stderr=null)
subprocess.call([i.format(path=tempdir) for i in merge_command],stdout=null,stderr=null)
print "Done!"
time.sleep(sleep_time) # optional sleep -- in case you want to slow things down for HDD strain or reliability or something time.sleep(sleep_time) # optional sleep -- in case you want to slow things down for HDD strain or reliability or something
# Remove the temp dir and all files in it # Remove the temp dir and all files in it