From cdd6fe95ba11db69f7a65130b922f2ac96569922 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 17 Sep 2025 16:17:34 +0200 Subject: auto overwrite files in ffmpeg --- cogs/compression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cogs') diff --git a/cogs/compression.py b/cogs/compression.py index b684f9f..177f543 100644 --- a/cogs/compression.py +++ b/cogs/compression.py @@ -41,9 +41,9 @@ class Compression(commands.Cog): logger.info(f"Compression started for: {file_type}") if file_type == "Video": - command = f"ffmpeg -i {file_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10,scale=trunc(iw*0.5/2)*2:trunc(ih*0.5/2)*2' -preset ultrafast -c:a libopus -b:a 500 {output_path}" + command = f"ffmpeg -y -i {file_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10,scale=trunc(iw*0.5/2)*2:trunc(ih*0.5/2)*2' -preset ultrafast -c:a libopus -b:a 500 {output_path}" elif file_type == "Audio": - command = f"ffmpeg -i {file_path} -ac 1 -b:a 500 -acodec libopus {output_path}" + command = f"ffmpeg -y -i {file_path} -ac 1 -b:a 500 -acodec libopus {output_path}" elif file_type == "Image": ext = os.path.splitext(file_path)[1].lower() if ext in [".jpg", ".jpeg"]: -- cgit v1.2.3