Last active
August 28, 2021 07:51
-
-
Save Lucchetto/add8d1fb0eece88aae0ced0f6033a8ff to your computer and use it in GitHub Desktop.
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
import os | |
video_path = input("Insert full path of videos: ") | |
subs_path = input("Insert full puth of subtitles: ") | |
# Assume both lists have the same length | |
video_files = os.listdir(video_path) | |
subs_files = os.listdir(subs_path) | |
output_path = input("Insert full path of output: ") | |
for index in range(len(video_files)): | |
current_video_abs_path = os.path.abspath(video_files[index]) | |
current_subs_abs_path = os.path.abspath(subs_files[index]) | |
# Use "\" because windows gay | |
output_file_abs_path = output_path + "\" + os.path.basename(video_files[index]) | |
"ffmpeg -i " + current_video_abs_path + " -i " + current_subs_abs_path + " -map 0 -map 1 -c copy " + output_file_abs_path | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oppai