|
|
|
@ -6,7 +6,9 @@ import subprocess
|
|
|
|
|
|
|
|
|
|
def ffmpeg_install_windows():
|
|
|
|
|
try:
|
|
|
|
|
ffmpeg_url = "https://github.com/GyanD/codexffmpeg/releases/download/6.0/ffmpeg-6.0-full_build.zip"
|
|
|
|
|
ffmpeg_url = (
|
|
|
|
|
"https://github.com/GyanD/codexffmpeg/releases/download/6.0/ffmpeg-6.0-full_build.zip"
|
|
|
|
|
)
|
|
|
|
|
ffmpeg_zip_filename = "ffmpeg.zip"
|
|
|
|
|
ffmpeg_extracted_folder = "ffmpeg"
|
|
|
|
|
|
|
|
|
@ -49,7 +51,9 @@ def ffmpeg_install_windows():
|
|
|
|
|
os.remove(os.path.join(ffmpeg_extracted_folder, "README.txt"))
|
|
|
|
|
os.rmdir(ffmpeg_extracted_folder)
|
|
|
|
|
|
|
|
|
|
print("FFmpeg installed successfully! Please restart your computer and then re-run the program.")
|
|
|
|
|
print(
|
|
|
|
|
"FFmpeg installed successfully! Please restart your computer and then re-run the program."
|
|
|
|
|
)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(
|
|
|
|
|
"An error occurred while trying to install FFmpeg. Please try again. Otherwise, please install FFmpeg manually and try again."
|
|
|
|
@ -96,12 +100,16 @@ def ffmpeg_install_mac():
|
|
|
|
|
def ffmpeg_install():
|
|
|
|
|
try:
|
|
|
|
|
# Try to run the FFmpeg command
|
|
|
|
|
subprocess.run(['ffmpeg', '-version'], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
subprocess.run(
|
|
|
|
|
["ffmpeg", "-version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
|
|
|
|
)
|
|
|
|
|
except FileNotFoundError as e:
|
|
|
|
|
# Check if there's ffmpeg.exe in the current directory
|
|
|
|
|
if os.path.exists("./ffmpeg.exe"):
|
|
|
|
|
print('FFmpeg is installed on this system! If you are seeing this error for the second time, restart your computer.')
|
|
|
|
|
print('FFmpeg is not installed on this system.')
|
|
|
|
|
print(
|
|
|
|
|
"FFmpeg is installed on this system! If you are seeing this error for the second time, restart your computer."
|
|
|
|
|
)
|
|
|
|
|
print("FFmpeg is not installed on this system.")
|
|
|
|
|
resp = input(
|
|
|
|
|
"We can try to automatically install it for you. Would you like to do that? (y/n): "
|
|
|
|
|
)
|
|
|
|
@ -114,9 +122,7 @@ def ffmpeg_install():
|
|
|
|
|
elif os.name == "mac":
|
|
|
|
|
ffmpeg_install_mac()
|
|
|
|
|
else:
|
|
|
|
|
print(
|
|
|
|
|
"Your OS is not supported. Please install FFmpeg manually and try again."
|
|
|
|
|
)
|
|
|
|
|
print("Your OS is not supported. Please install FFmpeg manually and try again.")
|
|
|
|
|
exit()
|
|
|
|
|
else:
|
|
|
|
|
print("Please install FFmpeg manually and try again.")
|
|
|
|
|