Created
April 5, 2021 11:44
-
-
Save alrafiabdullah/98695d9a60ef75a51d23deb1c5ea40b2 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
for mkv in mkv_list: | |
name, ext = os.path.splitext(mkv) | |
if ext != ".mkv": | |
raise Exception("Please add MKV files only!") | |
output_name = name + ".mp4" | |
try: | |
subprocess.run( | |
["ffmpeg", "-i", f"assets/{mkv}", "-codec", "copy", f"result/{output_name}"], check=True | |
) | |
except: | |
raise Exception( | |
"Please DOWNLOAD, INSTALL & ADD the path of FFMPEG to Environment Variables!" | |
) | |
print(f"{len(mkv_list)} video(s) converted to MP4!") | |
os.startfile("result") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment