Skip to content

Instantly share code, notes, and snippets.

@Lucchetto
Last active August 28, 2021 07:51
Show Gist options
  • Save Lucchetto/add8d1fb0eece88aae0ced0f6033a8ff to your computer and use it in GitHub Desktop.
Save Lucchetto/add8d1fb0eece88aae0ced0f6033a8ff to your computer and use it in GitHub Desktop.
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
@Praveensenpai
Copy link

Oppai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment