Fix for multi processing

This commit is contained in:
2021-02-07 23:41:12 +00:00
parent 0d1fbe09d6
commit ffbedd971d

View File

@@ -142,7 +142,7 @@ def do():
video_in = dest video_in = dest
processed_audio = os.path.join(processed_audio_dir, filename.split(".")[0] + ".wav") processed_audio = os.path.join(processed_audio_dir, filename.split(".")[0] + ".wav")
final_output_name = os.path.join(final, filename) final_output_name = os.path.join(final, filename)
# do_command("Help: Command=Popmute") do_command("New:")
do_command("Import2: Filename={}".format(video_in)) do_command("Import2: Filename={}".format(video_in))
time.sleep(5) time.sleep(5)
do_command("SelectAll:") do_command("SelectAll:")
@@ -156,12 +156,12 @@ def do():
do_command("SelectAll:") do_command("SelectAll:")
do_command("RemoveTracks:") do_command("RemoveTracks:")
time.sleep(5) time.sleep(5)
# do_command('Close:') # do_command('Close:') TODO THis causes audacity to wait for a input
# final_output_name = "output-" + # final_output_name = "output-" +
# TODO Folderisation of output by lecture # TODO Folderisation of output by lecture
print("Combining video at {} with audio at {}".format(video_in, processed_audio)) print("Combining video at {} with audio at {}".format(video_in, processed_audio))
# https://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg # https://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg
call('ffmpeg -i {} -i {} -acodec copy -vcodec copy -map 0:v:0 -map 1:a:0 {}'.format(video_in, processed_audio, final_output_name), shell=True) call('ffmpeg -i {} -i {} -acodec copy -vcodec copy -map 0:v:0 -map 1:a:0 {}'.format(video_in, processed_audio, final_output_name), shell=True)
print("\033[92mDone! Result is at {}".format(final_output_name)) print("\033[92mDone! Result is at {}\e[0m".format(final_output_name))
print("Munging complete!!!")
do() do()