Compare commits

...

2 Commits

Author SHA1 Message Date
c480e7c4e0 Output in mp4 not mkv 2021-02-08 00:04:23 +00:00
ffbedd971d Fix for multi processing 2021-02-07 23:41:12 +00:00

View File

@@ -141,8 +141,8 @@ def do():
# Extract audio, process it, add it back to the video
video_in = dest
processed_audio = os.path.join(processed_audio_dir, filename.split(".")[0] + ".wav")
final_output_name = os.path.join(final, filename)
# do_command("Help: Command=Popmute")
final_output_name = os.path.join(final, filename.split(".")[0] + ".mp4")
do_command("New:")
do_command("Import2: Filename={}".format(video_in))
time.sleep(5)
do_command("SelectAll:")
@@ -156,12 +156,12 @@ def do():
do_command("SelectAll:")
do_command("RemoveTracks:")
time.sleep(5)
# do_command('Close:')
# do_command('Close:') TODO THis causes audacity to wait for a input
# final_output_name = "output-" +
# TODO Folderisation of output by lecture
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
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()